BUG: Connection Fails with SQLSetConnectOption-SQLConnect

Last reviewed: September 18, 1996
Article ID: Q126613
The information in this article applies to:
  • Microsoft Open Database Connectivity, version 2.0

BUG# QJET: 1870 (2.00.2317)

SYMPTOMS

After 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.

WORKAROUND

Invoke SQLSetConnectOption to set SQL_CURRENT_QUALIFIER after the connection has been established, (that is, SQLConnect or SQLDriverConnect has succeeded).

STATUS

Microsoft 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
FOX PARADOX TEXT VISUAL BASIC VISUAL C++ MFC Windows NT
KBCategory: kbprg kberrmsg
KBSubcategory:



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.