?
Solved

Abort in OnBeforeDelete?

Posted on 2004-09-07
10
Medium Priority
?
462 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 400 total points
ID: 11995843
i know it doesn't ...

just use as:

if .... then
  Abort;
0
Independent Software Vendors: 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

777 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