BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DBNavigator Confirmation

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Craig Leidy
Guest





PostPosted: Mon Jan 12, 2004 8:18 pm    Post subject: DBNavigator Confirmation Reply with quote



I'm using the DBNavigator connected to an Advantage DB in D5.
When someone hits the Delete (minus) Button I want to be sure
they know they are deleting a bunch of stuff.
So... I want to ask a special question.
"Are you sure you want to Delete <item> everywhere?"
Cause it's in at least 3 files.

Since I don't see an easy way to change the text of the Confirm Delete
Question, I opted for the BeforeAction of the Navigator.
If they say "Yes" then I'll do all summary deletes in the event
and let the DBNavigator do the rest.
If they say "No" I'll just jump the summary deletes...
But how do I get the Navigator to not delete the current record?

Thanks, Craig.





Back to top
Ignacio Vazquez
Guest





PostPosted: Mon Jan 12, 2004 8:35 pm    Post subject: Re: DBNavigator Confirmation Reply with quote



Craig Leidy wrote:

Quote:
But how do I get the Navigator to not delete the current record?

Call Abort.

--
Cheers,
Ignacio

Help improve Delphi: http://qc.borland.com/

Back to top
Bill Todd (TeamB)
Guest





PostPosted: Mon Jan 12, 2004 9:44 pm    Post subject: Re: DBNavigator Confirmation Reply with quote



On Mon, 12 Jan 2004 15:18:41 -0500, "Craig Leidy"
<surfsoft (AT) comcast (DOT) net> wrote:

Quote:
But how do I get the Navigator to not delete the current record?

By raising an exception. One way to do that is to raise a silent
exception by calling SysUtils.Abort.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Back to top
Jon Purvis
Guest





PostPosted: Tue Jan 13, 2004 5:27 pm    Post subject: Re: DBNavigator Confirmation Reply with quote

Craig Leidy wrote:
Quote:
I'm using the DBNavigator connected to an Advantage DB in D5.
When someone hits the Delete (minus) Button I want to be sure
they know they are deleting a bunch of stuff.
So... I want to ask a special question.
"Are you sure you want to Delete <item> everywhere?"
Cause it's in at least 3 files.

Since I don't see an easy way to change the text of the Confirm Delete
Question, I opted for the BeforeAction of the Navigator.
If they say "Yes" then I'll do all summary deletes in the event
and let the DBNavigator do the rest.
If they say "No" I'll just jump the summary deletes...
But how do I get the Navigator to not delete the current record?


procedure TFormClasses.DBNavigator1BeforeAction(Sender: TObject; Button:
TNavigateBtn);
begin
with DataModuleMN do begin
else if Button=nbDelete then begin
if MessageDlg('Deleting class will also delete associated class '
+'participation records. Delete now?', mtConfirmation,
[mbYes,mbNo],0)=mrYes
then TableClasses.Delete;
Abort;
end;
end;
end;


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.