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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to change ODBC behavior?

Status
Not open for further replies.

ZemogSC

Programmer
Sep 29, 2003
30
US
Hi all,
We've got alot of legacy code and have been doing a major upgrade to our production system, and realzed that we may have to change possibly thousands of lines of code, and of course we're looking for a short cut. The newer ODBC Database we are using has the version 3 ODBC, while the older system has the version 2 ODBC. This machine is production and there is never any development on it or any planned in the future, we are upgrading the system due to being too far behind the current hardware/software versions for support by the vendor.

In C++ there is a function:

SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC2,SQL_IS_INTEGER);

Basically this statement tells the ODBC Driver manager to map the calls to an ODBC3 driver but exhibit ODBC2 behavior. This allows full backward comptability to older calls that may no longer be "supported" by the newer driver. Is there a similar way to do this in Access/VB?

Doing this would prevent many tedious code changes (it did with our C processes), any help would be greatly appreciated.
 
Are you coding in SQL or using the ODBC library directly?

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
I assume the VB client code uses ADO? Does ADO have anything for setting environment attributes (sorry, I don't remember)?

Have you tried to call SQLSetEnvAttr from the VB apps? The link below shows how to declare the function for the purpose of enabling connection pooling but the idea is the same (though you may need an henv for your purposes):


If the SQLSetEnvAttr "declare" approach works in VB, then you should be able to do the same in Access with a macro.

TR
 
The final verdict on this problem we had is to make sure the most current ODBC release from the vendor is working properly, and not a version that they accidently commented some code out in...

Basically we stepped thru numerous versions of the driver to find out that every version prior to the one they had us install worked fine, and they broke the driver in the one that they sent us. (First working version 3.2.0.0 last working version 3.2.0.10, the one they sent us 3.2.0.11).

Go figure.

Thanks for the repplies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top