Article View: borland.public.cppbuilder.database.ado
Article #2395ADO and Exception due to and connection lost
From: Francesco Russo
Date: Thu, 10 Jul 2003 16:56
Date: Thu, 10 Jul 2003 16:56
30 lines
1504 bytes
1504 bytes
Hi,
how can I determine if an Exception occurs because of a connection
loss or it occurs because of other errors.
Consider this code
// qry is a TADOQuery successfully declared, allocated and initialized
try{
qry->Close();
qry->SQL->Text = "select * from my table";
qry->Open();
}
catch(Exception &exc){
//PROBLEM: how can I determine if exception is due to connection
//loss or not (qyery timeout, syntax error etc.) ?
ShowMessage(exc.Message); // exc.Message is 'localized' : I need a
//unique way to determine the 'kind' of exception
}
catch (...){
ShowMessage("Damn: really bad error!!!");
return;
}
Thanks in advance for your attention :)
Francesco
Technical Details
Message-ID:
<3f0d1a09.2768300@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,9bf0b525026107aa,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-07-10 10:04:39 PST From: russo@photocity_dummy_antispam_.it (Francesco Russo) Newsgroups: borland.public.cppbuilder.database.ado Subject: ADO and Exception due to and connection lost Date: Thu, 10 Jul 2003 16:56:32 GMT Message-ID: <3f0d1a09.2768300@newsgroups.borland.com> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 62.101.81.136 X-Trace: newsgroups.borland.com 1057856192 62.101.81.136 (10 Jul 2003 09:56:32 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail