🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4841

Re: How to catch the ADOError!

#4841
From: Jurko
Date: Fri, 14 Sep 2001 10:09
30 lines
1800 bytes
In Builder you generally don't need to catch them by hand
because TADODataSet and other component wrapers for the
ADO COM objects catch them for you and map them to
VCL exceptions... namely to EOleException...

So you can do something like this...

try
{
    dset->Open();
}
catch ( EOleException& )
{
    ShowMessage( "We're in trouble... can't open dataset!" );
    return;
}

Ofcourse you can always do thinks at COM level and call COM
methods which return HRESULT status code which you can then
analyze to see whether the operation succeeded or not and if an
ADO operation failed you can check the ADODB.Connections
errors collection for a list of errors that happend...

HTH,
    Jurko

"fenye" <fenye@8848.net> wrote in message news:3ba195c0_1@dnews...
> Can you give me an Example!Thanks!
>
>
Technical Details
Message-ID: <3ba1d744$2_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3ba195c0_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,970ff68da081caf7
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-09-14 03:26:02 PST
Reply-To: "Jurko" <Jurko@ve-mil.hr>
From: "Jurko" <Jurko@ve-mil.hr>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3ba195c0_1@dnews>
Subject: Re: How to catch the ADOError!
Date: Fri, 14 Sep 2001 12:09:12 +0200
Lines: 32
Organization: Ve-mil
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 195.29.221.130
Message-ID: <3ba1d744$2_1@dnews>
X-Trace: dnews 1000462148 195.29.221.130 (14 Sep 2001 03:09:08 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews