Setting Tracing Options

The Tracing tab of the Administrator dialog box enables you to configure the way ODBC function calls are traced.

Note   The Trace ODBC Calls box in the Tracing tab does not take precedence over the ODBC Test Tools menu Trace command. For more information, see “ODBC Test Overview.”

How Tracing Works

When you activate tracing from the Tracing tab, the Driver Manager will log all ODBC function calls for all subsequently run applications. ODBC function calls from applications running before tracing is activated are not logged. ODBC function calls are recorded in a log file you specify.

Tracing ceases only after you click Stop Tracing Now. Keep in mind that while tracing is on, the log file continues to increase in size, and that this affects the performance of your ODBC applications.

For more information about tracing, see “Tracing” in Chapter 17, “Programming Considerations,” in the ODBC Programmer’s Reference.

Enabling and Disabling Tracing

To enable tracing

  1. Make sure the ODBC Administrator is running. (See “Running the ODBC Administrator.”)

  2. On the Tracing tab, click Start Tracing Now to enable tracing. Tracing can be enabled whether a connection has been made or not. After it is clicked, the Start Tracing Now button is replaced by a Stop Tracing Now button, which can be used to disable the tracing.

  3. To change the path and file name of the log file, enter text in the Log File Path text box. This box displays the path and file name for the file that the tracing information will be stored in. The default path and file name (Sql.log) are taken from the system information. To specify a new file, either enter a new path and file name, or click Browse and select a directory and file.

  4. To select a trace DLL other than Odbctrac.dll to perform tracing, enter a path and file name in the Custom Trace DLL text box. The Odbctrac.dll file that is shipped with the ODBC SDK can be replaced by a custom DLL of your choice. Enter the path and file name of the custom DLL, or click Select DLL to browse the directories for the custom DLL.

  5. Click OK.

The Administrator dialog box closes.

Note   If tracing was enabled in the When To Trace control of the Tracing tab, all ODBC applications that you run after you close the Data Sources dialog box will have all ODBC function calls appended to the file you selected. If tracing was enabled with the Start Tracing Now button, tracing ends when the Administrator dialog box is closed.

To disable tracing

  1. Make sure the ODBC Administrator is running. (See “Running the ODBC Administrator.”)

  2. Click the Tracing tab, then click Stop Tracing Now.

Enabling and Disabling Visual Studio Analyzer Tracing

Visual Studio™ Analyzer Tracing provides performance and debugging information about the ODBC layer. All outbound events will be fired at the top-level interface to present as accurate a picture as possible regarding time spent in ODBC components. Visual Studio Analyzer Tracing requires any event source to register when the source is set up. For more information about this type of tracing, see the white paper “ODBC 3.7 Visual Studio Analyzer Events

" within Microsoft Data Access Technical Articles.

To enable Visual Studio Analyzer Tracing

  1. Make sure the ODBC Administrator is running. (See “Running the ODBC Administrator”.)

  2. On the Tracing tab, click Start Visual Studio Analyzer Tracing to enable continuous Visual Studio Analyzer tracing.

    After it is clicked, the Start Visual Studio Analyzer Tracing button is replaced by a Stop Visual Studio Analyzer Tracing button, which can be used to disable the tracing.

    Ignore the Log File Path text box. The path and file name of the log file are irrelevant because events are written to the Visual Studio Analyzer.

  3. To select a trace DLL other than Odbctrac.dll to perform tracing, enter a path and file name in the Custom Trace DLL text box. Click Select DLL to browse the directories for the custom DLL.

  4. Click OK. The Administrator dialog box closes. Visual Studio Analyzer tracing continues recording to the analyzer until the Stop Visual Studio Analyzer Tracing button is clicked after opening the Administrator.

To disable Visual Studio Analyzer Tracing

  1. Make sure the ODBC Administrator is running. (See “Running the ODBC Administrator.”)

  2. On the Tracing tab, click Stop Visual Studio Analyzer Tracing.

After you click the Stop Visual Studio Analyzer Tracing button, it is replaced by a Start Visual Studio Analyzer Tracing button, which you can use to enable tracing.