StarQuest Technical Documents

How to Generate an ODBC Trace

Last Update: 25 April 2017
Product: StarSQL, StarQuest Data Replicator
Version: All
Article ID: SQV00SQ018


This document explains how to generate an ODBC API Trace from the ODBC Data Source Administrator. ODBC API traces are useful to StarQuest Technical Support for isolating problems.

You may also be asked to generate a DRDA trace. See How to Generate a DRDA Trace for instructions.


Shut down the application (or service) before enabling the ODBC trace.


1. Launch the ODBC Data Source Administrator by going to Start | Settings | Control Panel | Administrative Tools | Data Sources (ODBC).

2. Select the Tracing tab.

3. Edit the Log File Path and provide a complete path to a new file (e.g. C:\ODBC_Trace.log). This is ignored if you use Machine-Wide tracing.

4. If you are tracing a service, check the box "Machine-Wide tracing for all user identities".

5. Click the Start Tracing Now button. Click OK to close the ODBC Data Source Administrator.

6. Restart the application and reproduce the problem or error message that you wish to capture in the ODBC trace.

7. After reproducing the problem, reopen the ODBC Data Source Administrator.

8. Select the Tracing tab, click the Stop Tracing Now button.

9. Locate the trace file and compress the file before sending to StarQuest Technical Support.

Note: We have discovered that the Log file path is ignored when using the Machine-wide Tracing.

If the service is running as Local System Account, the ODBC trace will be created as SQL.LOG in the \Windows\temp directory.

If the service is running as a specified user, the trace is created as SQL.LOG in the temp directory of that user. For example, if you are tracing a SQL Server Linked Server, and the SQL Server service is running as MSSQL$SQLEXPRESS, you will find the trace file in C:\Users\MSSQL$SQLEXPRESS\AppData\Local\Temp.


To capture an ODBC trace on UNIX, set the following in /usr/local/etc/odbcinst.ini:

Trace = 1
Trace File = /tmp/sql.log



The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization.  The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.