AnyDAC
ContentsIndexHome
PreviousUpNext
Debugging and Reporting Environment Questions

The list of questions and answers related to the debugging and reporting environment.

Group
Links
QD1: How can I obtain Client / Session info like ADExplorer?

A: DBMS Environment Reports 

QD2: So, how I can produce trace / monitor output ?

A: Tracing and Monitoring 

QD3: How to temporarily enable / disable trace / monitor output ?

A: Use TADMoniXxxxClientLink.Tracing. It enables or disables tracing output for specific tracer kind. Also, to enable or disable trace output for specific established connection use the ADConnection.ConnectionIntf.Tracing. 

 

QD4: What is the meaning of EventKind's ?

A: The list:

  • LiveCycle: Object creation / destruction. For example, IADPhysConnection is created.
  • Error: DBMS errors.
  • ConnConnect: Connection open / close.
  • ConnTransact: Start / Commit / Rollback.
  • ConnService: Some special events.
  • CmdPrepare: IADPhysCommand.Prepare calls.
  • CmdExecute: IADPhysCommand.Execute or Open calls.
  • CmdDataIn: Command parameter values.
  • CmdDataOut: Resultset rows.
  • AdaptUpdat: All about posting updates.
  • Vendor: The low level DBMS API calls.
  • Component: Some high level events.

 

QD5: In which unit and where in the code can I view the SQL statement, I need to do some debugging ?

A: You can do that using one of the following options:

  • You can use MonitorBy connection parameter.
  • Open uADPhysManager.pas, find there TADPhysCommand.Prepare method and there is the InternalPrepare method call. Set breakpoint there and check value of the FDbCommandText field. It is the SQL command text, as it will be sent to a DBMS.

 

QD6: How to get the final SQL statement with all the params and macros replaced ?

A: See TADQuery.Text. Note, that AnyDAC does not substitute parameter values into the final SQL command text. 

 

QD7: I enabled trace output and getting constant Access Violations. What is wrong ? Is it a bug ? 

A: AnyDAC for the ODBC based drivers uses the Microsoft ODBC driver manager tracing facilities. To produce the trace output manager internally uses C RTL functions IsBadReadPtr / IsBadWritePtr, which internally can generate a controlled AV. The exception will be not propagated outside of the manager, but IDE debugger stops on it. Just ignore them.

What do you think about this topic? Send feedback!