Solved

Abort in OnBeforeDelete?

Posted on 2004-09-07
10
453 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
  • 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 90
Virtuailstring tree add node to another virtuailstring tree list 4 115
select query - oracle 16 100
Tvertscrollbox like a whatsapp layout 5 28
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

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