BUG: SQL Server's ODBC Function SQLConnect is Not Thread Safe

Last reviewed: March 18, 1997
Article ID: Q151593
6.00 2.50.0126 WINDOWS kbbug6.00

The information in this article applies to:

  • Microsoft SQL Server, version 6.0

BUG#: 13031 (6.00)

SYMPTOMS

When a threaded application performs many simultaneous open connections, the application can abnormally terminate. If running a Windows based application it can simply disappear. If running a console based application it may produce the following:

   Assertion failed: (Status == ERROR_OUTOFMEMORY) || (Status ==
   ERROR_NOT_ENOUGH_MEMORY) || (Status == ERROR_CANTREAD) || (Status ==
   ERROR_FILE_NOT_FOUND)

Either environment can cause Dr. Watson, or system debugger, to be activated. In some cases, the debugger will report OS error 87,'Invalid parameters passed to the debugger'.

CAUSE

The connection functions SQLConnect and SQLDriverConnect are not thread safe.

WORKAROUND

Serialize all calls to open a connection.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server 6.00 Service Pack 1 (SP1). The SQL Server ODBC Driver has been corrected in the Microsoft SQL Server 6.50 release.


Additional reference words: 6.00 sp
KBCategory: kbinterop kbbug6.00 odbc
KBSubcategory: ssrvprog
Keywords : ssrvprog kbbuglist
Version : 6.00 2.50.0126
Platform : WINDOWS


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: March 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.