API:FireDAC.Comp.Client.TFDCommand.OnError

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnError: TFDErrorEvent read FOnError write FOnError;

C++

__property OnError;

Properties

Type Visibility Source Unit Parent
event published
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDCommand

Description

The event that fires when an error occurs, while the command is communicating with the DBMS.

FireDAC.Comp.Client.TFDCommand.OnError inherits from FireDAC.Comp.Client.TFDCustomCommand.OnError. All content below this line refers to FireDAC.Comp.Client.TFDCustomCommand.OnError.

The event that fires when an error occurs, while the command is communicating with the DBMS.

The OnError event that fires, when the command executes one of the following operations and an error occurs:

  • Prepare. The command is preparing the text of the DBMS command for execution.
  • Open. The command is executing the DBMS command to open cursor.
  • Execute. The command is executing the text of the DBMS command.
  • Fetch. The command is fetching rows from the cursor.

The event handler of OnError receives the following parameters:

You can handle OnError to analyze and modify the exception object. You can even create a new exception object and assign it to AException; if you do so, you must free the original exception object.

If AException is an instance of EFDDBArrayExecuteError, then it is a case of Array DML error handling.

See Also