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. SQLConnect With Custom ODBC Driver

SQLConnect With Custom ODBC Driver

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabasewindows-adminhelp
1 Posts 1 Posters 0 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.
  • K Offline
    K Offline
    KalliMan
    wrote on last edited by
    #1

    Dear all, I'm trying to write an ODBC Driver DLL. I register it with SQLInstallDriverEx and Implement "ConfigDSN" and "SQLConnect". With "SQLConfigDataSource" i register Some Data source( ds1 ), but if I try to connect via "SQLConnect" ODBC's "SQLGetDiagRec" return "Driver Doesn't support this function" !?!?. I found my DSN ( ds1 )in ODBC Data sources in Control Panel, and when i open it, ODBC shows an error message "Driver's ConfigDSN : Component not found in registry". But in registry in "ODBCINST" I have "ConnectFunctions=YNN" which mean that I support "ConfigDSN" !?!. The same situation after reinstal MDAC. My DLL's functions work fine if i load dll with "Afx/LoadLibrary". What is Wrong? Win2000 SP3, MDAC 2.8 -------------------- Here is my Driver String which i use to register my Odbc driver: LPCTSTR pszDriver = _T("MyDriver\0DRIVER=MyDriver.dll\0SETUP=MyDriver.dll\0SQLLevel=1\0FileUsage=0\0DriverODBCVer=01\0ConnectFunctions=YNN\0APILevel=2\0CPTimeout=60\0\0"); SQLInstallDriverEx(pszAttributes ,NULL, szLoc, FILENAME_MAX, &nLocLen, ODBC_INSTALL_COMPLETE, &nUsageCount ); -------------------- Here is my sample code for Connection ---------------------- rc = SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&henv); rc = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(SQLPOINTER)SQL_OV_ODBC3,0); rc = SQLAllocHandle(SQL_HANDLE_DBC,henv,&hdbc); rc = SQLConnect(hdbc,(SQLCHAR*) "ds1", SQL_NTS, (SQLCHAR*) "", SQL_NTS, (SQLCHAR*) "", SQL_NTS); ---------------------- Regards : KalliMan a

    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