INF: Driver Manager Resolution of Changed SQLGetInfo Values
  
PSS ID Number: Q114973
Article last modified on 11-16-1995
 
1.00 1.05 2.00
 
WINDOWS
 

---------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft Open Database Connectivity, version 1.0
---------------------------------------------------------------------
 
SUMMARY
=======
 
After the release of ODBC version 1.0, there was a small update in which,
among other changes, 2 fInfoTypes were added to the SQLGetInfo call,
namely: SQL_CORRELATION_NAME and SQL_NON_NULLABLE_COLUMNS.
 
These fInfoTypes were posted in Lib10 of the winext forum on CompuServe
with values of 65000 and 65001 respectively. With ODBC 1.05 and ODBC 2.0,
these values changed in the header files. This article discusses how these
changes are backward compatible and how they maintain compatibility of
version 1.0 applications and drivers with later versions of ODBC.
 
MORE INFORMATION
================
 
To determine the version of ODBC that a driver conforms to, the 1.05 and
2.0 versions of the ODBC Driver Manager, make a SQLGetInfo
(SQL_DRIVER_ODBC_VER) call into the driver. This driver ODBC version
fInfoType was added with ODBC 1.05 and ODBC 2.0. If the driver returns
SQL_ERROR, it is presumed to be a 1.0 driver.
 
When a 1.0 application makes a SQLGetInfo call for SQL_CORRELATION_NAME
into a 1.0 Driver, but using a 1.05 or 2.0 Driver Manager, the Driver
Manager will pass the value 65000 directly to the driver.
 
If a 1.0 application makes the same SQLGetInfo call into a 1.05 driver or
2.0 driver, the 1.05 or 2.0 Driver Manager will convert the 1.0 value of
65000 into the 2.0 value of 74 which the new driver was compiled for.
 
NOTE: If the 1.0 Driver Manager is used instead in the same circumstances,
the call will fail in the 1.05 or 2.0 driver because the 1.0 Driver Manager
would have passed the value 65000 directly to the driver.
 
ODBC version 1.05 was released so that ODBC applications may make use of
the ODBC Cursor Library (ODBCCURS.DLL). Thus, there is no compelling reason
for ODBC driver writers to recompile under ODBC 1.05. However, if this is
desired by the driver writer, then the driver must support SQLGetInfo
(SQL_DRIVER_ODBC_VER) and return 1.05 in rgbInfoValue so that the Driver
Manager does not mistakenly consider it to be a 1.0 driver. This way the
conversions for the fInfoType mentioned above can be applied by the new
Driver Manager.
 
KBCategory: kbusage
KBSubcategory:
 
Additional reference words: 1.00 1.05 2.0 SQLGetInfo compatibility
=============================================================================
Copyright Microsoft Corporation 1995.
