🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
5 messages
5 total messages Started by Sandi Wijaya Tue, 06 Mar 2001 08:29
Cancelling delete in BeforeDelete events ???
#5756
Author: Sandi Wijaya
Date: Tue, 06 Mar 2001 08:29
19 lines
1352 bytes
Hi, everyone.

I want to cancelling a delete process, in BeforeDelete event.
the code :

void __fastcall TDM_MaintChqType::Q_chqtypeBeforeDelete(TDataSet *DataSet)
{
/* checking codition before delete the record */
...
...

}

So, if the condition isn't fulfilled then I want to return to the caller,
because the event is void type, I can't do that. Then , how should I do  for
breaking /cancelling the proses of delete ???


Thank's in advance, someone.
Re: Cancelling delete in BeforeDelete events ???
#5669
Author: J. R. Antley
Date: Wed, 07 Mar 2001 01:09
40 lines
1763 bytes
Hi Sandi,

There is an horrible way to do it:

if (DeleteAllowed() == false)
{
  Abort();
}

Under the covers, this throws an exception and somebody catches it...  It
sux, but it will work.

JR

"Sandi Wijaya" <sandiwijaya@yahoo.com> wrote in message
news:3aa4a015_1@dnews...
> Hi, everyone.
>
> I want to cancelling a delete process, in BeforeDelete event.
> the code :
>
> void __fastcall TDM_MaintChqType::Q_chqtypeBeforeDelete(TDataSet *DataSet)
> {
> /* checking codition before delete the record */
> ...
> ...
>
> }
>
> So, if the condition isn't fulfilled then I want to return to the caller,
> because the event is void type, I can't do that. Then , how should I do
for
> breaking /cancelling the proses of delete ???
>
>
> Thank's in advance, someone.
>
>
>
>
Re: Cancelling delete in BeforeDelete events ???
#5672
Author: Sandi Wijaya
Date: Wed, 07 Mar 2001 03:50
29 lines
1618 bytes
Hi, Mr. Antley

I have tried that. It's working but When I tried to Continue the process,
the application return "access violation" error message. And then I tried to
the created executable application file  there's no return access violation
message.

I am worried about that it will make something stuck in memory. Is it normal
or not for access violation message in Aborting process ?

Thank you.


"J. R. Antley" <jantley@phoenixdsl.com> wrote in message
news:983u0o$ik06@bornews.inprise.com...
> Hi Sandi,
>
> There is an horrible way to do it:
>
> if (DeleteAllowed() == false)
> {
>   Abort();
> }
>
> Under the covers, this throws an exception and somebody catches it...  It
> sux, but it will work.
>
> JR
>
Re: Cancelling delete in BeforeDelete events ???
#5673
Author: J. R. Antley
Date: Wed, 07 Mar 2001 10:32
54 lines
2086 bytes
Hi Sandi,

You are right to worry about this.

At the time of this writing known to me, your only option is to derive your
own class from TADOTable and hook the virtual method Post.  I have some code
which does this; contact me by mail if interested.

JR

"Sandi Wijaya" <sandiwijaya@yahoo.com> wrote in message
news:3aa5b03f_1@dnews...
> Hi, Mr. Antley
>
> I have tried that. It's working but When I tried to Continue the process,
> the application return "access violation" error message. And then I tried
to
> the created executable application file  there's no return access
violation
> message.
>
> I am worried about that it will make something stuck in memory. Is it
normal
> or not for access violation message in Aborting process ?
>
> Thank you.
>
>
> "J. R. Antley" <jantley@phoenixdsl.com> wrote in message
> news:983u0o$ik06@bornews.inprise.com...
> > Hi Sandi,
> >
> > There is an horrible way to do it:
> >
> > if (DeleteAllowed() == false)
> > {
> >   Abort();
> > }
> >
> > Under the covers, this throws an exception and somebody catches it...
It
> > sux, but it will work.
> >
> > JR
> >
>
>
>
>
>
>
>
>
>
Re: Cancelling delete in BeforeDelete events ???
#5572
Author: Mark Guerrieri
Date: Fri, 30 Mar 2001 15:37
30 lines
1565 bytes
Just throw an exception to abort the delete.

Mark

"Sandi Wijaya" <sandiwijaya@yahoo.com> wrote in message
news:3aa4a015_1@dnews...
> Hi, everyone.
>
> I want to cancelling a delete process, in BeforeDelete event.
> the code :
>
> void __fastcall TDM_MaintChqType::Q_chqtypeBeforeDelete(TDataSet *DataSet)
> {
> /* checking codition before delete the record */
> ...
> ...
>
> }
>
> So, if the condition isn't fulfilled then I want to return to the caller,
> because the event is void type, I can't do that. Then , how should I do
for
> breaking /cancelling the proses of delete ???
>
>
> Thank's in advance, someone.
>
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads