Thread View: borland.public.cppbuilder.database.ado
6 messages
6 total messages
Started by Vladimir Stefanovic
Sun, 08 May 2005 10:18
How do you catch errors & messages in ADO?
Author: Vladimir Stefanovic
Date: Sun, 08 May 2005 10:18
Date: Sun, 08 May 2005 10:18
19 lines
1459 bytes
1459 bytes
Hi, I asked this a couple of weeks before, but without an answer (Thread: TADOTable & TADOQuery: OnPost() errors...) How do you know what to say to the user when you catch some post/insert/delete error in ADO? I think that saying "Some error occured" is not fair. I do it now by analyzing the string in 'E->Message' (the more details with code is in my original thread). Is there anything better? -- Best regards, Vladimir Stefanovic
Re: How do you catch errors & messages in ADO?
Author: Viatcheslav V. Vassiliev
Date: Sun, 08 May 2005 19:57
Date: Sun, 08 May 2005 19:57
33 lines
2104 bytes
2104 bytes
Try to examine TADOConnection::Errors collection. It contains error numbers - both COM and native (that goes from db server). //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net http://www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Vladimir Stefanovic" <antivari@po.sbb.co.yu> �������/�������� � �������� ���������: news:427de773@newsgroups.borland.com... > Hi, > > I asked this a couple of weeks before, but without an answer > (Thread: TADOTable & TADOQuery: OnPost() errors...) > > How do you know what to say to the user when you catch > some post/insert/delete error in ADO? I think that saying > "Some error occured" is not fair. > > I do it now by analyzing the string in 'E->Message' (the more > details with code is in my original thread). > > Is there anything better? > > > > -- > Best regards, > Vladimir Stefanovic >
Re: How do you catch errors & messages in ADO?
Author: Vladimir Stefanovic
Date: Sun, 08 May 2005 20:24
Date: Sun, 08 May 2005 20:24
42 lines
2401 bytes
2401 bytes
Thanks! -- Best regards, Vladimir Stefanovic "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message news:427e6f12@newsgroups.borland.com... > Try to examine TADOConnection::Errors collection. It contains error > numbers - both COM and native (that goes from db server). > > //------------------------------------------ > Regards, > Vassiliev V. V. > http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + > ADO.Net > http://www.oledbdirect.com - The fastest way to access MS SQL Server, > MS Jet (Access) and Interbase (through OLEDB) > > "Vladimir Stefanovic" <antivari@po.sbb.co.yu> �������/�������� � �������� > ���������: news:427de773@newsgroups.borland.com... >> Hi, >> >> I asked this a couple of weeks before, but without an answer >> (Thread: TADOTable & TADOQuery: OnPost() errors...) >> >> How do you know what to say to the user when you catch >> some post/insert/delete error in ADO? I think that saying >> "Some error occured" is not fair. >> >> I do it now by analyzing the string in 'E->Message' (the more >> details with code is in my original thread). >> >> Is there anything better? >> >> >> >> -- >> Best regards, >> Vladimir Stefanovic >> > >
Re: How do you catch errors & messages in ADO?
Author: George Nakos
Date: Thu, 11 Aug 2005 11:50
Date: Thu, 11 Aug 2005 11:50
24 lines
1797 bytes
1797 bytes
On Sun, 08 May 2005 22:57:06 +0300, Viatcheslav V. Vassiliev <support@oledbdirect.com> wrote: > Try to examine TADOConnection::Errors collection. It contains error > numbers - both COM and native (that goes from db server). > Could it be possible for somebody to provide with some sample code on how to do this (e.g. trap errors)? I know it's only a few lines of code, but it's a bit difficult for me. I don't use too much C++, I guess it's a try/catch block, but I haven't been able to trap ADO errors. BTW: I'm new on the forum, good to be here :) Best regards, George Nakos -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: How do you catch errors & messages in ADO?
Author: poojo hackma
Date: Mon, 21 Nov 2005 17:07
Date: Mon, 21 Nov 2005 17:07
38 lines
2359 bytes
2359 bytes
George,
Did you ever get a response to this? If not, try something like this:
try // this try closes the database if there are problems
{
try // this try catches your errors
{
ADOConnection1->Connect();
// do stuff with your connection
} catch (Exception* ex) {
MessageBox(NULL, ex->Message.c_str(), "DB Error", MB_OK);
}
}
__finally {
ADOConnection1->Close();
}
"George Nakos" <gnakos@metronco.gr> wrote in message
news:op.svcdtzk4qf2fxd@promitheas.metron.internal...
On Sun, 08 May 2005 22:57:06 +0300, Viatcheslav V. Vassiliev
<support@oledbdirect.com> wrote:
> Try to examine TADOConnection::Errors collection. It contains error
> numbers - both COM and native (that goes from db server).
>
Could it be possible for somebody to provide with some sample code on how
to do this (e.g. trap errors)? I know it's only a few lines of code, but
it's a bit difficult for me. I don't use too much C++, I guess it's a
try/catch block, but I haven't been able to trap ADO errors.
BTW: I'm new on the forum, good to be here :)
Best regards,
George Nakos
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: How do you catch errors & messages in ADO?
Author: George Nakos
Date: Tue, 22 Nov 2005 10:46
Date: Tue, 22 Nov 2005 10:46
15 lines
1400 bytes
1400 bytes
On Mon, 21 Nov 2005 19:07:16 +0200, poojo hackma <poojo.com/mail> wrote: > George, > > Did you ever get a response to this? If not, try something like this: I did, but thanks for the reply! -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
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