Board index » delphi » Handling Key Violations

Handling Key Violations

Try TDataSet.OnPostError.

Glenn.

Quote
Jeff Cook wrote:
> I am trying to handle a Key Violation myself.  I want to put up a
> meaningful message and allow the user to retry.

> I thought the the "OnEditError" event would be the place to put in a
> message and then "Action := daRetry", but it doesn't seem to work.

> Any ideas?

> --
> Jeff Cook

> At work: Phone:+64-9-424 5388
> ++++++++ Mobile: +64-21-635 185
> ++++++++ Program Development/Client Support
> ++++++++ Aspect Systems Ltd
> ++++++++ Software for Real Estate & Human Resources
> At home: Phone:  +64-9-424 0336
> ++++++++ Husband, Dad, Grandad
> ++++++++ Enthusiastic but slow triathlete
> ++++++++ Justice of the Peace

 

Re:Handling Key Violations


I am trying to handle a Key Violation myself.  I want to put up a
meaningful message and allow the user to retry.

I thought the the "OnEditError" event would be the place to put in a
message and then "Action := daRetry", but it doesn't seem to work.

Any ideas?

--
Jeff Cook

At work: Phone:+64-9-424 5388
++++++++ Mobile: +64-21-635 185
++++++++ Program Development/Client Support
++++++++ Aspect Systems Ltd
++++++++ Software for Real Estate & Human Resources
At home: Phone:  +64-9-424 0336
++++++++ Husband, Dad, Grandad
++++++++ Enthusiastic but slow triathlete
++++++++ Justice of the Peace

Re:Handling Key Violations


Thanks, Glenn,  that did it.

Jeff

Quote
Glenn Casteran wrote:
> Try TDataSet.OnPostError.

> Glenn.

> Jeff Cook wrote:

> > I am trying to handle a Key Violation myself.  I want to put up a
> > meaningful message and allow the user to retry.

> > I thought the the "OnEditError" event would be the place to put in a
> > message and then "Action := daRetry", but it doesn't seem to work.

> > Any ideas?

> > --
> > Jeff Cook

> > At work: Phone:+64-9-424 5388
> > ++++++++ Mobile: +64-21-635 185
> > ++++++++ Program Development/Client Support
> > ++++++++ Aspect Systems Ltd
> > ++++++++ Software for Real Estate & Human Resources
> > At home: Phone:  +64-9-424 0336
> > ++++++++ Husband, Dad, Grandad
> > ++++++++ Enthusiastic but slow triathlete
> > ++++++++ Justice of the Peace

--
Jeff Cook

At work: Phone:+64-9-424 5388
++++++++ Mobile: +64-21-635 185
++++++++ Program Development/Client Support
++++++++ Aspect Systems Ltd
++++++++ Software for Real Estate & Human Resources
At home: Phone:  +64-9-424 0336
++++++++ Husband, Dad, Grandad
++++++++ Enthusiastic but slow triathlete
++++++++ Justice of the Peace

Other Threads