INF: Improper Usage of dbclose() Can Cause Disconnect Message

Last reviewed: April 29, 1997
Article ID: Q114958

The information in this article applies to:
  • Microsoft SQL Server Programmer's Toolkit, version 4.2

SUMMARY

Improper usage of the dbclose() function in a DB-Library (DB-Lib) program can result in several disconnection messages written to the error log and event viewer (SQL Server for Windows NT only). If a DB-Library program calls dbclose() before processing of results is complete, messages 17824, 232, and 109 will appear in the SQL Server for Windows NT error log and event viewer.

When clients are connected to an OS/2 server, the error log simply contains the message:

   Cannot send, host process disconnected.

MORE INFORMATION

When dbclose() is called after dbsqlexec() and before dbresults() or before all processing is complete using dbresults(), the following error is logged in the NT event viewer as eventID 17058 (the error will also appear in the SQL Server error log):

   Error: 17824, Severity 10, State 0
   Unable to write to ListenOn connection
   "\\.\pipe\sql\query',loginame 'sa',hostname''.
   OS Error: 232, The pipe is being closed

If the client is connected to an OS/2 server, the error log will contain the following entry:

   kernel Cannot send, host process disconnected: <a negative integer>
spid: 1

A properly developed DB-Library program should call dbcancel() before dbclose() if results do not need to be processed. Note that this behavior will appear when using DB-Library versions 4.21 or 4.20.50.


Additional query words: dbclose client 17824 232 109 dblib
Keywords : kbprg SSrvDB_Lib
Version : 4.2.5 4.21 | 4.2.5
Platform : OS/2 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: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.