BUG: Connection Fails with SQLSetConnectOption-SQLConnectLast reviewed: September 18, 1996Article ID: Q126613 |
The information in this article applies to:
BUG# QJET: 1870 (2.00.2317)
SYMPTOMSAfter using SQLSetConnectOption to set SQL_CURRENT_QUALIFIER to a valid data source path, the following SQLConnect (or SQLDriverConnect) will return SQLSetConnectOption failure message, and a connection is established without current qualifier set to that desired path. NOTE: It occurs with all the desktop database drivers. For example, in case of Microsoft Access driver, do the following:
SQLAllocConnect(henv, &hdbc); SQLSetConnectOption( hdbc, SQL_CURRENT_QUALIFIER, "C:\ODBC20\SMPLDATA\ACCESS\SAMPLE" ); //Note: It's a valid path SQLConnect( hdbc, "sdk21-Access", SQL_NTS, "admin", SQL_NTS, NULL, 0 ); //Note: DSN points to "C:\ODBCSDK\SMPLDATA\ACCESS\SAMPLE"You will get:
SQL_SUCCESS_WITH_INFO, IM006, "[Microsoft][ODBC DLL] Driver's SQLSetConnectOption failed" 08003, "[Microsoft][ODBC Driver pack 2.0 Driver]Connection is not open"The 08003 is misleading. Actually, the connection to sdk21-Access has been established with the current qualifier set to C:\ODBCSDK\SMPLDATA\ACCESS\SAMPLE.
WORKAROUNDInvoke SQLSetConnectOption to set SQL_CURRENT_QUALIFIER after the connection has been established, (that is, SQLConnect or SQLDriverConnect has succeeded).
STATUSMicrosoft has confirmed this to be a problem in ODBC DeskTop Database Drivers Pack version 2.00.2317. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional reference words: 2.00.2317 ODBC ACCESS BTRIEVE DBASE EXCEL
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |