Solved

Abort in OnBeforeDelete?

Posted on 2004-09-07
10
461 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:Wyverex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
10 Comments
 
LVL 6

Expert Comment

by:bpana
ID: 11995812
Abort;
0
 

Author Comment

by:Wyverex
ID: 11995836
TDataSet doesn't know a method called Abort though...
0
 
LVL 6

Accepted Solution

by:
bpana earned 100 total points
ID: 11995843
i know it doesn't ...

just use as:

if .... then
  Abort;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:bpana
ID: 11995853
Abort raises a silent exception, so it will exit the current procedure without making the post.
0
 

Author Comment

by:Wyverex
ID: 11995886
Ah. Didn't know that there was something like this in Delphi.
Thx alot!
0
 
LVL 6

Expert Comment

by:bpana
ID: 11995887
btw, this is in the Delphi help.
check the Delphi Help for BeforeDelete event.
0
 
LVL 6

Expert Comment

by:bpana
ID: 11995894
you welcome :)
0
 

Author Comment

by:Wyverex
ID: 11995909
>> 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 ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11996835
:-)) funny,
the solution is in the title
0
 
LVL 6

Expert Comment

by:bpana
ID: 11996848
yes :-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question