BUG: Cursor Library Fails to Close Buffer

Last reviewed: December 17, 1996
Article ID: Q158622
The information in this article applies to:
  • Microsoft Open Database Connectivity SDK Version 2.5
BUG #: 4317 (ODBC3.0 SDK)

SYMPTOMS

Under certain situations, multithreaded applications using the ODBC Cursor Library generate the following error message:

   SQLFreeStmt:
      szSqlState = S1000
      pfNativeError = 0
      szErrorMsg = [Microsoft][ODBC Cursor Library]
                   General error: Unable to close or remove file buffer.

Applications using MFC database classes with snapshots use the ODBC Cursor Library, so they may also generate this error message.

WORKAROUND

If you are using the ODBC API, change the connection option to use driver cursors, such as SQLSetConnectOption( .. SQL_ODBC_CURSORS, SQL_CUR_USE_DRIVER). Use Dynasets when using MFC Database Classes.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft ODBC SDK 2.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following sequence outlines the scenario:

  1. The primary thread connects to the ODBC driver using the ODBC Cursor Library.

  2. The primary thread runs queries and generates result sets.

  3. The primary thread creates a thread that launches processes (and need not use any ODBC calls) with the CreateProcess() API, with the bInheritHandles parameter set to TRUE.

  4. When the primary thread tries to close the result set by issuing SQLFreeStmt() SQL_CLOSE, the error message noted above may be generated.

For more information on the CreateProcess() API, refer to the Win 32 SDK documentation.


Additional reference words: 2.50 VC
KBCategory: kbusage kbbug2.50 kbother
KBSubcategory: ODBC SDK


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: December 17, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.