🚀 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 David Thu, 09 Feb 2006 13:55
How to I catch ADO exceptions?
#664
Author: David
Date: Thu, 09 Feb 2006 13:55
9 lines
1150 bytes
Hi

How do I catch exceptions created by ADO components?

What I have done is I am using TADOQuery to create a table, but 
everytime I execute the code it throws an exception saying this table 
has been created. I would like to catch this.

Thanks
Re: How to I catch ADO exceptions?
#665
Author: Mike Shkolnik
Date: Thu, 09 Feb 2006 14:18
22 lines
1550 bytes
try
  yourTADOQuery.SQL.Text := 'CREATE TABLE .....';
  yourTADOQuery.ExecSQL;
except
end;

--
With best regards, Mike Shkolnik
EMail: mshkolnik@scalabium.com
http://www.scalabium.com

"David" <no@email.com> wrote in message
news:43eb4900@newsgroups.borland.com...
> Hi
>
> How do I catch exceptions created by ADO components?
>
> What I have done is I am using TADOQuery to create a table, but
> everytime I execute the code it throws an exception saying this table
> has been created. I would like to catch this.
>
> Thanks
Re: How to I catch ADO exceptions?
#666
Author: David
Date: Thu, 09 Feb 2006 14:31
30 lines
1796 bytes
I using C++ Builder, but I guess you are asking to use the try { } catch 
   (Exception &e) {}?

I have tried that and it doesnt work.

Mike Shkolnik wrote:
> try
>   yourTADOQuery.SQL.Text := 'CREATE TABLE .....';
>   yourTADOQuery.ExecSQL;
> except
> end;
> 
> --
> With best regards, Mike Shkolnik
> EMail: mshkolnik@scalabium.com
> http://www.scalabium.com
> 
> "David" <no@email.com> wrote in message
> news:43eb4900@newsgroups.borland.com...
>> Hi
>>
>> How do I catch exceptions created by ADO components?
>>
>> What I have done is I am using TADOQuery to create a table, but
>> everytime I execute the code it throws an exception saying this table
>> has been created. I would like to catch this.
>>
>> Thanks
> 
> 
Re: How to I catch ADO exceptions?
#667
Author: Mike Shkolnik
Date: Thu, 09 Feb 2006 15:48
12 lines
1313 bytes
> I using C++ Builder
My fault

> but I guess you are asking to use the try { } catch (Exception &e) {}?
Yes

>I have tried that and it doesnt work.
Show you code and exact error message.
--
With best regards, Mike Shkolnik
EMail: mshkolnik@scalabium.com
http://www.scalabium.com
Re: How to I catch ADO exceptions?
#668
Author: Arnie
Date: Thu, 09 Feb 2006 21:19
24 lines
1534 bytes
"David" <no@email.com> wrote in message 
news:43eb4900@newsgroups.borland.com...
> Hi
>
> How do I catch exceptions created by ADO components?
>
> What I have done is I am using TADOQuery to create a table, but 
> everytime I execute the code it throws an exception saying this 
> table has been created. I would like to catch this.
>
> Thanks

try
{
    // do your table creation
}
catch ( const Exception & e )
{
    e.Message;  // Has the error text
}

??

- Arnie 
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