🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Database Error Handling

#2126
From: Charles Maples
Date: Sun, 09 Nov 2003 23:27
45 lines
2675 bytes
Check out the TApplication OnException event you can assign the applications
exceptions to an event handler you create. below is some example code. Also
look at the events for the ADO Component you are using they have numerous
error events where you can prevent the exception dialog box from coming up


void __fastcall TErrorHandler::DataModuleCreate(TObject *Sender)
{
       Application->OnException = AppException;
}
//--------------------------------------------------------------------------
-
void __fastcall TErrorHandler::AppException(TObject * Sender,Exception * E)
{
        //Deal with exception here
        ErrorWindow(E->Message); // My own Error Display Window
}


"Wolfgang Unger" <wolfgangunger@gmx.de> wrote in message
news:bolid8$jui$03$1@news.t-online.com...
> Hi,
> I'm not this experienced in
> C++(Java, perl is ok for me..)and
> have a problem in C++.
> I'm testing Database-Applications but
> don't have a way to catch Errors.
> In Java I know how to use try and catch, in
> C++ I need help.
> Maybe someone also knows a good tutorial...
> For examle, I want to take care of the situation, the path to
> the database ( from a ini-file)is wrong.
> I tried try...catch(...) but still I get a annoying
> popup-window, telling me a EOLEException happenend..
> I don't know how to create a EOLEException or EOLEError class.
> I dont't want my programm stop in this situation, I want
> to handle this in my code  with a Information for the user.
> I'm not so good in C++ error handling, not only database-errors, so
> another question: Isn't there something like the catch Throwable in
> Java, to take care of any error-situation, at least at the beginnig
> of the development...
> thanks a lot
> wolfgang
>
>
Technical Details
Message-ID: <3faecd3b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <bolid8$jui$03$1@news.t-online.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,1dd4db8ad5b46a1d
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-09 15:39:07 PST
From: "Charles Maples" <CharlesM@Tampabay.rr.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <bolid8$jui$03$1@news.t-online.com>
Subject: Re: Database Error Handling
Date: Sun, 9 Nov 2003 18:27:48 -0500
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 65.32.45.209
Message-ID: <3faecd3b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1068420411 65.32.45.209 (9 Nov 2003 15:26:51 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail