Link to home
Start Free TrialLog in
Avatar of Wyverex
Wyverex

asked on

Abort in OnBeforeDelete?

Hi,

I have a TClientDataSet and want to display my own confirmation dialog when a user wants to delete a record. So I decided to use TDataSet.OnBeforeDelete to accomplish this.
My problem is now, if the user selects "no", how do I prevent the DataSet from deleting the record?
I haven't found a method for this purpose yet, although I'm quite sure there has to be one.
I guess it's very easy....

thx for your help,
Wyverex
Avatar of bpana
bpana

Abort;
Avatar of Wyverex

ASKER

TDataSet doesn't know a method called Abort though...
ASKER CERTIFIED SOLUTION
Avatar of bpana
bpana

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Abort raises a silent exception, so it will exit the current procedure without making the post.
Avatar of Wyverex

ASKER

Ah. Didn't know that there was something like this in Delphi.
Thx alot!
btw, this is in the Delphi help.
check the Delphi Help for BeforeDelete event.
you welcome :)
Avatar of Wyverex

ASKER

>> btw, this is in the Delphi help.
>> check the Delphi Help for BeforeDelete event.

Yes, I've seen that before. But I always thought Abort is a member of TDataSet. And because I couldn't find it in TDataSet I later forgot to look elsewhere ;-)
Avatar of kretzschmar
:-)) funny,
the solution is in the title
yes :-)