Board index » off-topic » TQuery, Cached Updates and OnUpdateError

TQuery, Cached Updates and OnUpdateError


2003-10-14 10:36:03 PM
off-topic6
Hallo,
Env.: Delphi 6 Ent. UP2, BDE 5.2.0.2, Paradox
I use TQuery with CachedUpdates = True. All working fine. Now I want to
catch errors in OnUpdateError. How?
e.g. A table has an unique index on a field named description. When a user
wants to add a new record with a description already exists, he should get
an own created error message and not the "original index exception".
Kind regards
Stephan
 
 

Re:TQuery, Cached Updates and OnUpdateError

procedure UpdateError(DataSet: TDataSet;E: EDatabaseError; UpdateKind:
TUpdateKind;var UpdateAction: TUpdateAction);
The object E has the property message.
UpdateAction := uaFail -->Aborts the update operation and displays an
error message.
uaAbort -->Aborts the update operation without
displaying an error message.
I suppose that you apply updates for single record --
AfterPost-->ApplyUpdates;
"Stephan Schneider" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote
Hallo,

Env.: Delphi 6 Ent. UP2, BDE 5.2.0.2, Paradox

I use TQuery with CachedUpdates = True. All working fine. Now I want to
catch errors in OnUpdateError. How?

e.g. A table has an unique index on a field named description. When a user
wants to add a new record with a description already exists, he should get
an own created error message and not the "original index exception".

Kind regards
Stephan