IBX.IBCustomDataSet.TIBCustomDataSet.OnUpdateError
Delphi
property OnUpdateError: TIBUpdateErrorEvent read FOnUpdateError write FOnUpdateError;
C++
__property TIBUpdateErrorEvent OnUpdateError = {read=FOnUpdateError, write=FOnUpdateError};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | published | IBX.IBCustomDataSet.pas IBX.IBCustomDataSet.hpp |
IBX.IBCustomDataSet | TIBCustomDataSet |
Description
Occurs if an exception is generated when cached updates are applied to a database.
Write an OnUpdateError event handler to respond to exceptions generated when cached updates are applied to a database.
Because there is a delay between the time a record is first cached and the time cached updates are applied, there is a possibility that another application may change one or more of the same records in the database before the cached changes can be applied. DataSet is the name of the dataset to which updates are applied.
The error handler can use the OldValue and NewValue properties of TField to evaluate error conditions, and set NewValue to a new value to reapply. In this case, set UpdateAction to uaRetry before exiting.
Note: If a call to ApplyUpdates raises an exception and ApplyUpdates is not called within the context of a try..except (Delphi) or try..catch (C++) block, an error message is returned. If an OnUpdateError handler cannot correct the error condition and leaves UpdateAction set to uaFail, the error message is returned twice. To prevent re-return, set UpdateAction to uaAbort in the error handler.
Warning: Important: The code in an OnUpdateError handler must not call any methods that make a different record the current one.