Microsoft KB Archive/138539

= INF: ODBC SQL Server Driver Server Messages =

Article ID: 138539

Article Last Modified on 11/14/2003

-

APPLIES TO


 * Microsoft SQL Server 6.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition
 * Microsoft Open Database Connectivity 2.5

-



This article was previously published under Q138539



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 KB138539

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.