INF: ODBC SQL Server Driver Server Messages

Last reviewed: April 8, 1997
Article ID: Q138539

The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 & 6.5
  • Microsoft Open Data Base Connectivity, version 2.5

SUMMARY

This article documents how the Microsoft ODBC SQL Server Driver reports messages returned from SQL Server.

MORE INFORMATION

If the Microsoft ODBC SQL Server Driver receives a message from SQL Server, it will return SQL_ERROR or SQL_SUCCESS_WITH_INFO to the ODBC function call. If the application then calls SQLError, the driver will return information similar to the following:

   szSqlState = "37000"
   pfNativeError = "170"
   szErrorMsg = "[Microsoft][ODBC SQL Server Driver][SQL Server] Line 1:
                 Incorrect syntax near 'wheer'."

The pfNative code and szErrorMsg string contain the message from SQL Server.

The szErrorMsg string breaks down as follows:

   "[Microsoft][ODBC SQL Server Driver]"
      This is the standard header for szErrorMsg strings coming
      from the Microsoft SQL Server driver, it indicates the
      error was detected in the driver itself.

   "[SQL Server]"
      This indicates that SQL Server is the component which issued
      the message.

   "Line 1: Incorrect syntax near 'driver'."
      This is the actual text of the error message returned from
      SQL Server.

The driver returns the error code it received from SQL Server in the pfNative parameter. You can look up the error codes in either Chapter 26, "System Messages" in the SQL Server 6.0 or 6.5 "Administrator's Companion," or in Appendix C, System Messages from the SQL Server 4.2 "Troubleshooting Guide."


Additional query words: sql6 windows nt err
Keywords : kbusage SSrvGen
Version : 2.5 6.0 6.5
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: April 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.