The ODBC Driver Manager has a trace facility that allows the sequence of function calls made by an ODBC application to be recorded into a log file. Tracing is performed by a trace DLL, which captures calls between the application and the Driver Manager, and between the Driver Manager and the driver. This article describes how to start and stop ODBC tracing.
To stop tracing, follow either of the previous procedures, depending on the type of application, except this time you must click Stop Tracing Now
, which would then read Start Tracing Now
- If tracing does not appear to be working (that is, no trace file is generated or an empty file is created), you can turn it on by editing the registry directly. To make sure tracing is turned on, locate both of the registry locations listed previously, set Trace to 1, and set TraceDll and TraceFile to appropriate values. This action forces tracing to be on for all applications, regardless of whether they are running under the system account or the current user account.
- Always specify a full path like "C:\Sql.log" (without the quotes) in the Log File Path option.
- The Apply button is activated when you change the Log File Path. Either click OK or click Apply so that the changes take effect.
- Do not forget to turn tracing off when you are done with the troubleshooting. If you keep tracing set to on, it degrades your application performance.
- If you are using Microsoft ActiveX Data Objects (ADO), you may not be able to get any ODBC tracing. This occurs because ADO is an OLEDB Consumer and it uses OLEDB instead of ODBC. You do have ODBC tracing with ADO, but only if you are using the Microsoft OLEDB Provider for ODBC Driver (MSDASQL) Provider.
For additional information about ODBC Tracing, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
'One-time Only' Tracing Option Does Not Stop Automatically
ODBC Tracing to SQL.LOG Can Slow SQL or Consume All Space
Tracing SQL Generated by MS SQL Server ODBC Driver
Driver Manager Trace Facility Logs User Names and Password
Article ID: 274551 - Last Review: July 1, 2004 - Revision: 2.2
- Microsoft Data Access Components 1.5
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7