Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDatabase and ODBC version

Status
Not open for further replies.

snorkelgirl

Programmer
Sep 21, 2005
1
0
0
US
My CDatabase object defaults to ODBC 2.0 behavior, when I need 3.0 behavior.

CDatabase defaults to ODBC 2.0 behavior by calling SQLAllocEnv from its AllocConnect function. I derived a new OpenEx function which incorporates the AllocConnect functionality, but instead calls SQLAllocHandle and SQLSetEnvAttr to set the ODBC behavior to 3.0.

But later I have problems when CDatabase functions use pDbState->m_henvAllConnections, which doesn't reflect my values. And it appears CDatabase calls functions which are specific to ODBC 2.0.

Is there any other way to set the ODBC behavior to 3.0?
Or is there a more current version of CDatabase which defaults to 3.0? (I am using version 4.2)
Finally, if I must use a derived class, how do I include the line PROCESS_LOCAL(_AFX_DB_STATE, _afxDbState) so the CDatabase class uses the same object?

Please help! This is driving me crazy.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top