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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to use ADO without #import directive?

How to use ADO without #import directive?

Scheduled Pinned Locked Moved C / C++ / MFC
databasecomtutorialquestion
1 Posts 1 Posters 7 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    hello, Can any has code that tells how to use ADO without #import directive?? I am trying to use because you have to hard code path or ado15.dll in ado. here is my code but CoCreateInstance failed. I am initializinf COM, importing ADO header files, and liniking ado lib file. ************************* ADOConnection* pAdoConnection; HRESULT hr; // Create instances of ADOConnection hr = CoCreateInstance(CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER, IID_IADOConnection, reinterpret_cast(&pAdoConnection) ); if ( FAILED(hr) ) { AfxMessageBox("CreateInstance failed!"); return; } // Call ADOConnection's Open method to connect to a database hr = pAdoConnection->Open((BSTR)"Kruse", (BSTR)"", (BSTR)"", -1); if ( ! FAILED(hr) ) { AfxMessageBox("open failed"); return; } *************************** thanks in advance mahesh

    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