This topic discusses how to diagnose issues that may arise when connecting to Microsoft® SQL Server™ using the SQL Server ODBC driver.
szSqlState = "IM002", *pfNativeError = 0,
szErrorMsg="[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
The ODBC driver manager could not find the ODBC data source. Make sure the data source name was given correctly. Also make sure the data source name was defined using the same Microsoft Windows® account the application is running under, or it is a system data source. If the application is running as a Microsoft Windows NT® service, the data source must be a system data source.
For additional information, see Adding a Data Source.
szSqlState = "IM003", *pfNativeError = 0,
szErrorMsg="[Microsoft][ODBC Driver Manager] specified driver could not be loaded"
The driver manager count not load the driver DLL successfully, Sqlsrv32.dll. Make sure a valid version of Sqlsrv32.dll is in the client’s path.
szSqlState = "S1000", *pfNativeError = 126,
szErrorMsg="[Microsoft][ODBC Driver Manager] Unable to load communication module. Driver has not been correctly installed."
The SQL Server driver could not load the SQL Server client Net-Library. Verify that the ODBC data source specifies a valid Net-Library name. Verify that a valid version of the Net-Library .dll is in the client’s path. This may also occur if the .dlls and files making up the underlying network protocol stack, such as Novell’s SPX/IPX, or a TCP/IP protocol stack, are not installed properly. Verify the components with the network administrator, or reinstall the client network components.
[Microsoft][ODBC SQL Server Driver][Net-Libraryname]
Net-Libraryname is the display name of a SQL Server client Net-Library (for example, Named Pipes, Shared Memory, Multiprotocol, TCP/IP Sockets, NwLink IPX/SPX, or Banyan VINES). The remainder of the error messages contains the Net-Library function called and the function called in the underlying network API by the TDS function. The pfNative error code returned with these errors is the error code from the underlying network protocol stack. Work with the network administrator or your SQL Server support vendor to determine a likely cause for the network error.