Board index » cppbuilder » [C++ Builder 5] catching ADO errors

[C++ Builder 5] catching ADO errors


2005-08-23 05:57:35 PM
cppbuilder7
Hi there,
When I run a query using TADOQuery with a zero recordset, I get an
exception thrown at me.
Can anyone supply with code on how to trap all ADO errors? (I suspect it's
a try...catch block, but my C++ isn't my forte).
Also, how can I tell to the de{*word*81} (Builder 5) to let my application
handle exceptions using try...catch instead of reporting errors?
Thanks, George
--
Using Opera's revolutionary e-mail client: www.opera.com/mail/
 
 

Re:[C++ Builder 5] catching ADO errors

This is not a language issue.
For your future reference, there is ADO group for this...
Quote
Can anyone supply with code on how to trap all ADO errors?
(I suspect it's a try...catch block, but my C++ isn't my forte).
try / catch works fine for me with TADOQuery, but you should
know that IDE (de{*word*81}) catches exceptions anyway. If you
start the app from explorer, no messages will be present with
this skeleton...
try
{
// EXECUTE A QUERY
}
catch ( const Exception &e )
{
// swallow error message
}
--
Best regards,
Vladimir Stefanovic
 

Re:[C++ Builder 5] catching ADO errors

George Nakos wrote:
Quote
Also, how can I tell to the de{*word*81} (Builder 5) to let my application
handle exceptions using try...catch instead of reporting errors?
In TD32, it is under Options/Exceptions. Set exceptions to None.
 

{smallsort}

Re:[C++ Builder 5] catching ADO errors

On Tue, 23 Aug 2005 16:47:06 +0300, Vladimir Stefanovic
< XXXX@XXXXX.COM >wrote:
Quote
This is not a language issue.

For your future reference, there is ADO group for this...
Point taken
Quote

try / catch works fine for me with TADOQuery, but you should
know that IDE (de{*word*81}) catches exceptions anyway. If you
start the app from explorer, no messages will be present with
this skeleton...


try
{
// EXECUTE A QUERY
}
catch ( const Exception &e )
{
// swallow error message
}
Ok, just turned off all exception catching from the de{*word*81} and all seems
to work ok.
Thanks, George
--
Using Opera's revolutionary e-mail client: www.opera.com/mail/
 

Re:[C++ Builder 5] catching ADO errors

On Tue, 23 Aug 2005 18:37:19 +0300, Bob Gonder
< XXXX@XXXXX.COM >wrote:
Quote

In TD32, it is under Options/Exceptions. Set exceptions to None.

Ok, it seems to be working now! I instructed the de{*word*81} not to catch
C++ exceptions and it doesn't!
--
Using Opera's revolutionary e-mail client: www.opera.com/mail/