RAD Studio VCL Reference
TIBCustomDataSet.OnUpdateError Event

Occurs if an exception is generated when cached updates are applied to a database.

property OnUpdateError: TIBUpdateErrorEvent;
__property TIBUpdateErrorEvent OnUpdateError;

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.


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!