Enabling Tracing
By setting the Trace and TraceFile keywords in the ODBC.INI registry entry. This enables or disables tracing
when SQLAllocHandle with a HandleType of SQL_HANDLE_ENV is called. These options are set in the Tracing tab of the ODBC Data Source Administrator dialog box displayed during data source setup. For more information, see “Registry Entries for Data Sources” in Chapter 19, “Configuring Data Sources.”
By calling SQLSetConnectAttr to set the SQL_ATTR_TRACE connection attribute to SQL_TRACE_ON. This enables
or disables tracing for the duration of the connection. For more information,
see the SQLSetConnectAttr function description.
By using ODBCSharedTraceFlag to turn tracing on or off dynamically. (For more information, see the next
section, “Dynamic Tracing.”)