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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. OleDb, IRowsetIndex

OleDb, IRowsetIndex

Scheduled Pinned Locked Moved ATL / WTL / STL
c++databasemysqlquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ArielR
    wrote on last edited by
    #1

    The following code is an ATL OLEDB Consumer Assesor. I need to Add to it the IRowsetIndex::Seek to perform a Seek. How I must to modify my code to permform it?. Thanks a lot. #ifndef __DBOITEMPROV_H_ #define __DBOITEMPROV_H_ class CdboItemProvAccessor { public: TCHAR m_Articulo[7]; double m_Cantidad; double m_Gravado; BEGIN_COLUMN_MAP(CdboItemProvAccessor) COLUMN_ENTRY(1, m_Articulo) COLUMN_ENTRY(2, m_Cantidad) COLUMN_ENTRY(3, m_Gravado) END_COLUMN_MAP() void ClearRecord() { memset(this, 0, sizeof(*this)); } }; class CdboItemProv : public CCommand > { public: HRESULT Open( char* mySql ) { HRESULT hr; hr = OpenDataSource(); if (FAILED(hr)) return hr; return OpenRowset( mySql ); } HRESULT OpenDataSource() { HRESULT hr; CDataSource db; CDBPropSet dbinit(DBPROPSET_DBINIT); dbinit.AddProperty(DBPROP_AUTH_CACHE_AUTHINFO, true); dbinit.AddProperty(DBPROP_AUTH_ENCRYPT_PASSWORD, false); dbinit.AddProperty(DBPROP_AUTH_MASK_PASSWORD, false); dbinit.AddProperty(DBPROP_AUTH_PASSWORD, ""); dbinit.AddProperty(DBPROP_AUTH_USERID, "Admin"); dbinit.AddProperty(DBPROP_INIT_DATASOURCE, OLESTR("S:\\NuevoSis\\Principal\\Principal.mdb")); dbinit.AddProperty(DBPROP_INIT_MODE, (long)16); dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4); dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, ""); dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033); binit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false); //hr = db.Open(_T("Microsoft.Jet.OLEDB.4.0"), &dbinit); hr = db.OpenWithServiceComponents("Microsoft.Jet.OLEDB.4.0", &dbinit); if (FAILED(hr)) return hr; m_session.Close(); return m_session.Open(db); } HRESULT OpenRowset( char* mySql ) { // Set properties for open CDBPropSet propset(DBPROPSET_ROWSET); propset.AddProperty(DBPROP_CANSCROLLBACKWARDS, true); propset.AddProperty(DBPROP_IRowsetChange, true); propset.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE); propset.AddProperty(DBPROP_IMMOBILEROWS, true); return CCommand >::Open(m_session, mySql, &propset); } CSession m_session; }; #endif // __DBOITEMPROV_H_

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

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