How can I control the SQL application that runs the Delphi application?

Is there a way in Delphi XE to have an SQL monitor that tracks all the SQL executed by my application? Delphi 5 had a component for this.

+4
source share
1 answer

As already suggested here , you can use the TAdoConnection.OnWillExecute event to send requests to the console, for example:

procedure TDataModuleProd.ADOConnection1WillExecute( Connection: TADOConnection; var CommandText: WideString; var CursorType: TCursorType; var LockType: TADOLockType; var CommandType: TCommandType; var ExecuteOptions: TExecuteOptions; var EventStatus: TEventStatus; const Command: _Command; const Recordset: _Recordset); begin {$ifdef DEBUG} OutputDebugString(PChar('SQL Execute: ' + CommandText)); {$endif} end; 
+2
source

All Articles