This topic discusses how to diagnose issues that may arise when using the Microsoft® SQL Server™ ODBC Driver.
"[Microsoft][ODBC SQL Server driver][DBMSxxxx]"
If DBMSxxxx is the name of a SQL Server Client Net-Library, the problem is a connectivity or network problem. For more information, see Diagnosing ODBC Connection Errors.
"[Microsoft][ODBC SQL Server driver][SQL Server]"
The error is coming from SQL Server. The pfNative variable returned by SQLError() is the SQL Server error code. Follow the directions for this error number in ODBC Error Message Format. Also, you should review the problem with the database administrator.
szSqlState = "37000", *pfNativeError = 170,
szErrorMsg="[Microsoft][ODBC SQL Server Driver][SQL Server]
Line 1: Incorrect syntax near '*'."
or from the ODBC SQL Server Driver, you need to determine if the problem is with the SQL statements given to the SQL Server ODBC driver by the application, or with the Transact-SQL statements generated by the driver.
Use the ODBC trace to see the SQL statements passed from the application to the SQL Server ODBC driver. The ODBC trace is activated from the ODBC icon in Control Panel.
If the trace shows that the SQL statements coming from the application are not using valid Transact-SQL or ODBC SQL syntax, diagnose the application.
If the trace shows that the application is passing valid Transact-SQL or ODBC SQL statements to the driver, use SQL Server Profiler to trace the Transact-SQL statements sent from the SQL Server ODBC driver to SQL Server. For more information, see Monitoring with SQL Server Profiler.