Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

Donwangugi

@Donwangugi
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Ole Db Consumer
    D Donwangugi

    **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();
    }**
    
    ATL / WTL / STL c++ database help com tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups