Function OdbcTraceMode() Professional

Retrieves or sets the low-level trace mode of the ODBC driver manager.

Syntax
OdbcTraceMode([<lTraceOn>]) --> lTraceMode
Parameters
<lTraceOn>
If the parameter is passed, the trace mode will be turned on (.T.) or off (.F.). If the parameter is not passed, the current setting is returned only.
Return

The function returns the current setting of the trace mode.

Description

The ODBC driver manager provides a trace mechanism where every call to itself is recorded, including parameters and return states. This can be very helpful for troubleshooting and for enhancements to the ODBCDBE as well. The output will be written to a file which can be named by OdbcTraceFile().

Examples
Create ODBCDBE trace file
// This sample shows how to 
// create a trace file of ODBC calls. 

PROCEDURE MAIN(cConnect) 
LOCAL oSession 
LOCAL cPrevTraceFile 

   cPrevTraceFile := OdbcTraceFile("myodbc.log") 

   // don't trace the connection calls 
   OdbcTraceMode(.F.) 
   oSession := DacSession():new( cConnect ) 

   IF oSession:isConnected() 
      // only trace the USE 
      OdbcTraceMode(.T.) 
      USE test NEW 
      DbSkip() 
      USE test NEW 
      DbSkip() 
      CLOSE ALL 
      OdbcTraceMode(.F.) 
   ENDIF 

   OdbcTraceFile(cPrevTraceFile) 

RETURN 

PROCEDURE DbeSys 
   DbeLoad( "ODBCDBE" ) 
   DbeSetDefault( "ODBCDBE" ) 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.