Click here to Skip to main content
15,912,205 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionHow to I create a Check List Box? Pin
monsieur_jj17-Jun-08 17:48
monsieur_jj17-Jun-08 17:48 
AnswerRe: How to I create a Check List Box? Pin
Rahul Vaishnav17-Jun-08 19:40
Rahul Vaishnav17-Jun-08 19:40 
GeneralRe: How to I create a Check List Box? Pin
monsieur_jj17-Jun-08 20:54
monsieur_jj17-Jun-08 20:54 
GeneralRe: How to I create a Check List Box? [modified] Pin
monsieur_jj18-Jun-08 15:34
monsieur_jj18-Jun-08 15:34 
GeneralRe: How to I create a Check List Box? Pin
Steve Echols18-Jun-08 22:45
Steve Echols18-Jun-08 22:45 
GeneralRe: How to I create a Check List Box? Pin
monsieur_jj19-Jun-08 14:41
monsieur_jj19-Jun-08 14:41 
GeneralRe: How to I create a Check List Box? Pin
monsieur_jj19-Jun-08 15:51
monsieur_jj19-Jun-08 15:51 
QuestionOle Db Consumer Pin
Donwangugi`9-Jun-08 10:02
Donwangugi`9-Jun-08 10:02 
I am trying to create an Ole DB Consumer in order to access data from a table for a conduit application. The problem is that whenever I use the wizard to generate the code it does not generate the data members needed to correspond to the columns of the table I wish to work with.

Do yo have any idea why this would happen?

I can show you an example I saw on another website. Using the wizard with a table called Authors generates the code:

// code generated on Wednesday, April 17, 2002, 10:25 AM
class CAuthorsAccessor
{
public:
    LONG m_Au_ID;
    TCHAR m_Author[51];
    SHORT m_YearBorn;

    // The following wizard-generated data members contain status
    // values for the corresponding fields in the column map. You
    // can use these values to hold NULL values that the database
    // returns or to hold error information when the compiler returns
    // errors. See Field Status Data Members in Wizard-Generated
    // Accessors in the Visual C++ documentation for more information
    // on using these fields.
    // NOTE: You must initialize these fields 
    //       before setting/inserting data!

    DBSTATUS m_dwAu_IDStatus;
    DBSTATUS m_dwAuthorStatus;
    DBSTATUS m_dwYearBornStatus;

    // The following wizard-generated data members contain length
    // values for the corresponding fields in the column map.
    // NOTE: For variable-length columns, you must initialize these
    //       fields before setting/inserting data!

    DBLENGTH m_dwAu_IDLength;
    DBLENGTH m_dwAuthorLength;
    DBLENGTH m_dwYearBornLength;

    void GetRowsetProperties(CDBPropSet* pPropSet)
    {
        pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, 
            true, DBPROPOPTIONS_OPTIONAL);
        pPropSet->AddProperty(DBPROP_CANSCROLLBACKWARDS, 
            true, DBPROPOPTIONS_OPTIONAL);        
        pPropSet->AddProperty(DBPROP_IRowsetChange, 
            true, DBPROPOPTIONS_OPTIONAL);
        pPropSet->AddProperty(DBPROP_UPDATABILITY, 
            DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT 
            | DBPROPVAL_UP_DELETE);
    }
    HRESULT OpenDataSource()
    {
        CDataSource _db;
        HRESULT hr;
        // Here goes the _db.OpenFromInitializationString
        
        if (FAILED(hr))
        {
#ifdef _DEBUG
            AtlTraceErrorRecords(hr);
#endif
            return hr;
        }
        return m_session.Open(_db);
    }

    void CloseDataSource()
    {
        m_session.Close();
    }

    operator const CSession&()
    {
        return m_session;
    }

    CSession m_session;
    DEFINE_COMMAND_EX(CAuthorsAccessor, L" \
     SELECT \
        Au_ID, \
        Author, \
        'Year Born' \
        FROM Authors")

    BEGIN_COLUMN_MAP(CAuthorsAccessor)
        COLUMN_ENTRY_LENGTH_STATUS(1, m_Au_ID, 
           m_dwAu_IDLength, m_dwAu_IDStatus)
        COLUMN_ENTRY_LENGTH_STATUS(2, 
           m_Author, m_dwAuthorLength, m_dwAuthorStatus)
        COLUMN_ENTRY_LENGTH_STATUS(3, 
            m_YearBorn, m_dwYearBornLength, m_dwYearBornStatus)
    END_COLUMN_MAP()
};


Notice the data members I have highlighted with bold? Those are each columns of the table Authors.

When working with my Table, which is called TABLE-CAREER-INTAKE this code is generated:

// code generated on Thursday, June 05, 2008, 12:57 PM

class CTABLECAREERINTAKE4Accessor
{
public:

	void GetRowsetProperties(CDBPropSet* pPropSet)
	{
		pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
		pPropSet->AddProperty(DBPROP_CANSCROLLBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
		pPropSet->AddProperty(DBPROP_IRowsetChange, true, DBPROPOPTIONS_OPTIONAL);
		pPropSet->AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE);
	}

	HRESULT OpenDataSource()
	{
		CDataSource _db;
		HRESULT hr;
// The connection string below may contain plain text passwords and/or
// other sensitive information. Please remove the #error after reviewing
// the connection string for any security related issues. You may want to
// store the password in some other form or use a different user authentication.
		hr = _db.OpenFromInitializationString(L"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=P:\\CareerDb\\db1.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False");
		if (FAILED(hr))
		{
#ifdef _DEBUG
			AtlTraceErrorRecords(hr);
#endif
			return hr;
		}
		return m_session.Open(_db);
	}

	void CloseDataSource()
	{
		m_session.Close();
	}

	operator const CSession&()
	{
		return m_session;
	}

	CSession m_session;

	BEGIN_COLUMN_MAP(CTABLECAREERINTAKE4Accessor)
	END_COLUMN_MAP()
};


There are no such data members, despite the fact that my table has about 12 or so columns for each row.

Any ideas?
Sorry if there is an article or thread on this but I searched and could not find any.


AnswerRe: Ole Db Consumer Pin
Gene OK12-Jun-08 3:51
Gene OK12-Jun-08 3:51 
Questionhow to implement CStdioFile::WriteLine() with native C++ and STL? Pin
steven_wong4-Jun-08 14:20
steven_wong4-Jun-08 14:20 
AnswerRe: how to implement CStdioFile::WriteLine() with native C++ and STL? Pin
Jörgen Sigvardsson4-Jun-08 20:53
Jörgen Sigvardsson4-Jun-08 20:53 
GeneralRe: how to implement CStdioFile::WriteLine() with native C++ and STL? Pin
steven_wong5-Jun-08 1:07
steven_wong5-Jun-08 1:07 
Questionstd::find_if and std::equal_to Pin
Member 46952313-Jun-08 22:50
Member 46952313-Jun-08 22:50 
AnswerRe: std::find_if and std::equal_to Pin
Stephen Hewitt4-Jun-08 21:55
Stephen Hewitt4-Jun-08 21:55 
AnswerRe: std::find_if and std::equal_to Pin
Stuart Dootson5-Jun-08 15:01
professionalStuart Dootson5-Jun-08 15:01 
AnswerRe: std::find_if and std::equal_to Pin
Michael Dunn12-Jun-08 14:54
sitebuilderMichael Dunn12-Jun-08 14:54 
GeneralRe: std::find_if and std::equal_to Pin
Stephen Hewitt12-Jun-08 18:16
Stephen Hewitt12-Jun-08 18:16 
GeneralRe: std::find_if and std::equal_to Pin
Member 469523115-Jun-08 23:19
Member 469523115-Jun-08 23:19 
QuestionHow to make the ActiveX control full transparent int word Pin
liuguang1-Jun-08 16:55
liuguang1-Jun-08 16:55 
AnswerRe: How to make the ActiveX control full transparent int word Pin
Ju@ncho4-Jul-08 4:28
Ju@ncho4-Jul-08 4:28 
GeneralRe: How to make the ActiveX control full transparent int word Pin
liuguang6-Jul-08 15:18
liuguang6-Jul-08 15:18 
QuestionMFC-STL Pin
Yokeldj29-May-08 0:41
Yokeldj29-May-08 0:41 
QuestionCompiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help. Pin
Arris7426-May-08 6:33
Arris7426-May-08 6:33 
QuestionMaking use of an STL reducer application Pin
malte de moll24-May-08 6:24
malte de moll24-May-08 6:24 
AnswerRe: Making use of an STL reducer application Pin
Stuart Dootson29-May-08 21:37
professionalStuart Dootson29-May-08 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.