Article View: borland.public.cppbuilder.database.ado
Article #2832Re: ADO Error ?????
From: Derek
Date: Thu, 06 Mar 2003 07:44
Date: Thu, 06 Mar 2003 07:44
64 lines
2360 bytes
2360 bytes
Try using EOLeException as your catch object - if all else fails try catch (...) - that will get it but it you won't what the error is.
Cheers
Derek
"BayuFA" <bayufa@bdg.centrin.net.id> wrote:
>i used Error object from ADO to display errors..
>
>eg :
>
> rs->Connection = cn;
> rs->Open();
> int nCount;
> cn->Errors->Get_Count(nCount);
> if (nCount != 0)
> {
> for(int i = 0; i < nCount; i++)
> {
> WideString err;
> _di_Error MyErr;
> cn->Errors->Get_Item(Variant(i),MyErr);
> MyErr->Get_Description(err);
> Form1->UpdateError(AnsiString(err));
> }
> }
>
>thx
>
>"Sarath" <sarathbs@yahoo.com> wrote in message
>news:3e578abb@newsgroups.borland.com...
>> Hi Friends,
>>
>> Anybody got an idea how to catch ADO errors.....
>>
>> eg:
>>
>> ADOQuery->Active = false;
>> ADOQuery->AQL->Clear();
>> ADOQuery->AQL->Add("[Job_Code] Like '*'");
>> ADOQuery->Active = true;
>>
>> This gave me and error like
>>
>> "Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT'
>> or 'UPDATE'"
>> but after this error message the function getting aborted, I want to catch
>> this error, and procede to next query is there any way of handling this ?
>>
>> I tried
>> try{
>> }
>> catch(EDatabaseError &e) //(and EADOError &e also :( )
>>
>>
>> Thanks in advance
>> Sarath.
>>
>>
>>
>
>
Technical Details
Message-ID:
<3e66fc77$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mailReferences:
<3e578abb@newsgroups.borland.com> <3e5efee5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,d338aaa66b2e6b6a X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-03-05 23:54:19 PST From: "Derek" <derek.drury@co-op.co.uk> Sender: "Derek" <derek.drury@co-op.co.uk> Reply-To: "Derek" <derek.drury@co-op.co.uk> Subject: Re: ADO Error ????? Newsgroups: borland.public.cppbuilder.database.ado X-User-Info: 195.93.34.11 195.93.34.11 References: <3e578abb@newsgroups.borland.com> <3e5efee5@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3e66fc77$1@newsgroups.borland.com> Date: 5 Mar 2003 23:44:55 -0800 X-Trace: newsgroups.borland.com 1046936695 207.105.83.65 (5 Mar 2003 23:44:55 -0800) Lines: 66 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail