Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

handling EOleException

63 views
Skip to first unread message

David C. Balsley

unread,
Apr 2, 2001, 1:43:16 PM4/2/01
to
I'm converting an application from the BDE to ADO. I'm having a problem
handling an EOleException.

My application contains the following piece of code:

try
ADOTable1.Delete;
except
on E: EOleException do HandleDeleteException;
else
MessageDlg('Could not delete record.', mtError, [mbOk], 0);
raise;
end;

If I step through this code using the debugger, I get a message stating that
the line ADOTable1.Delete has raised the exception class EOleException. If
I compile and run my application, repeating the steps that generated the
EOleException in the debugger, my application executes the else clause in
the above code. So the debugger tells me that my code raises an
EOleException, but I can't seem to handle that EOleException.

I am using Delphi 5 with Update 1, ADOExpress with Updates 1 and 2, Windows
NT, and Access 2000.

What am I doing wrong?

Thanks in advance,
David Balsley


Brian Bushay TeamB

unread,
Apr 3, 2001, 9:33:45 PM4/3/01
to

>So the debugger tells me that my code raises an
>EOleException, but I can't seem to handle that EOleException.
>
>I am using Delphi 5 with Update 1, ADOExpress with Updates 1 and 2, Windows
>NT, and Access 2000.
>
>What am I doing wrong?

You probably are not doing anything wrong. There are some places in the
ADOExpress components code that use a Try/Except block to suppress errors your
are probably running into one of these.
--
Brian Bushay (TeamB)
Bbu...@NMPLS.com

dz

unread,
Apr 18, 2001, 11:12:54 PM4/18/01
to
I think that I've run into the same thing, which is very frustrating.
I assume that you're saying that there's really nothing that can be done about it??

Brian Bushay TeamB

unread,
Apr 20, 2001, 12:53:41 AM4/20/01
to

>I think that I've run into the same thing, which is very frustrating.
>I assume that you're saying that there's really nothing that can be done about it??

The original post your responding to is not clear enough to make that final a
determination.

Dub

unread,
Apr 20, 2001, 6:59:17 AM4/20/01
to
OK.
Anyway, I think that my problem might have been slightly different to that
described in the original post.
I have a bit of code that's something like this:
try
ADOConnection.starttransaction
ds1.updatebatch
ds2.updatebatch
ds3.updatebatch
etc
ADOConnection.committrans
except
ADOConnection.Rollback
end

Now, even ds3 fails (ie. an exception is raised), the updates to ds1 and ds2
are applied. I'm using Access2000, which I thought supported transactions
and rollbacks (could be wrong - I admit I don't know a whole bunch about
Access). ??
Dub
Brian Bushay TeamB <BBu...@Nmpls.com> wrote in message
news:7t8vdtok5096qqj3k...@4ax.com...

Brian Bushay TeamB

unread,
Apr 21, 2001, 2:05:21 AM4/21/01
to

>Now, even ds3 fails (ie. an exception is raised), the updates to ds1 and ds2
>are applied. I'm using Access2000, which I thought supported transactions
>and rollbacks (could be wrong - I admit I don't know a whole bunch about
>Access). ??

There is a problem with batchupdates when using multiple batches. If an update
fails previous batches updated in the same transaction will not be returned to
updated status. Is this what you are referring to?

0 new messages