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
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
Abort;
ASKER
TDataSet doesn't know a method called Abort though...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Abort raises a silent exception, so it will exit the current procedure without making the post.
ASKER
Ah. Didn't know that there was something like this in Delphi.
Thx alot!
Thx alot!
btw, this is in the Delphi help.
check the Delphi Help for BeforeDelete event.
check the Delphi Help for BeforeDelete event.
you welcome :)
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 ;-)
>> 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 ;-)
:-)) funny,
the solution is in the title
the solution is in the title
yes :-)