INF: Reading ODBC SQL Server Driver Network Messages

ID: Q137634


The information in this article applies to:


SUMMARY

This article discusses the meaning of the various pieces of information returned to SQLError if the Microsoft ODBC SQL Server driver encounters a network error when communicating with SQL Server, and how this information can offer insight into the cause of the problem.


MORE INFORMATION

If the Microsoft ODBC SQL Server driver encounters a network problem when communicating with SQL Server, it will return SQL_ERROR to the ODBC function call. If the application then calls SQLError, the driver will return information similar to the following:


   szSqlState = "01000"
   pfNativeError = 2
   szErrorMsg = "[Microsoft][ODBC SQL Server Driver][dbnmpntw]
                ConnectionOpen (CreateFile())" 
The pfNative code and szErrorMsg string contain information that can give you clues about the nature of the underlying network problem.

The szErrorMsg string breaks down as follows: The most important part of the szErrorMsg is the name of the network library. This indicates what network protocol is being used, and therefore how the network error code should be interpreted.

The Microsoft SQL Server driver returns the error code it received from the underlying network in the pfNative parameter. Users can look up the error codes for the network protocol to see what type of error is indicated by the pfNative value. The network protocol error codes are documented in different places:

dbnmpntw, dbnmp3: The codes returned from the named pipe API are consistent across Windows, Windows NT, and OS/2. They are codes listed in the Operating System Error Codes in the following Microsoft Knowledge Base article:
Q116401 INFO: OS/2 SQL Server Run-Time and OS Error Codes
To assist you in deciphering the messages returned, the following examples explain how to interpret the information returned on SQLError() if you attempt to connect with some of the network libraries to a SQL Server that is shut down: As you can see from these examples, the error codes returned are not always clear pointers to the underlying problems, but in many cases they are enough to give a network administrator or support professional some clues as to what may be wrong.

Additional query words: 2.5 sql6 windows nt


Keywords          : kbother SSrvErr_Log SSrvProg 
Version           : winnt:6.0,6.5
Platform          : winnt 
Issue type        : 

Last Reviewed: June 30, 1999