Article View: borland.public.cppbuilder.database.ado
Article #560Re: How do you catch errors & messages in ADO?
From: 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/
Technical Details
Message-ID:
<4381fe88$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<427de773@newsgroups.borland.com> <427e6f12@newsgroups.borland.com> <op.svcdtzk4qf2fxd@promitheas.metron.internal>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,a0b07e6435a98624 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "poojo hackma" <poojo.com/mail> Newsgroups: borland.public.cppbuilder.database.ado References: <427de773@newsgroups.borland.com> <427e6f12@newsgroups.borland.com> <op.svcdtzk4qf2fxd@promitheas.metron.internal> Subject: Re: How do you catch errors & messages in ADO? Date: Mon, 21 Nov 2005 11:07:16 -0600 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Response X-Antivirus: avast! (VPS 0546-6, 11/20/2005), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 12.45.133.147 Message-ID: <4381fe88$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1132592776 12.45.133.147 (21 Nov 2005 09:06:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail