FireDAC.Comp.Client.TFDAdaptedDataSet.OnError

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnError: TFDErrorEvent read FOnError write FOnError;

C++

__property Firedac::Stan::Error::TFDErrorEvent OnError = {read=FOnError, write=FOnError};

Properties

Type Visibility Source Unit Parent
event public
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDAdaptedDataSet

Description

The event is triggered when an error is generated, while the dataset is talking to the DBMS.

The OnError event is triggered, when the dataset executes one of the following dataset operations and an error is generated:

  • Prepare. The dataset is preparing the DBMS command for execution.
  • Open. The dataset is executing the DBMS command to open the cursor.
  • ExecSQL/ExecProc/Execute. The dataset is executing the DBMS command.
  • Fetch. The dataset 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.

You can also use the OnExecuteError event to handle the Array DML errors, and the OnUpdateError event to handle the updates posting errors.

See Also