Article View: borland.public.cppbuilder.database.ado
Article #5094Re: create ADO componets maunal!
From: Henrik Franz�n
Date: Wed, 11 Jul 2001 07:13
Date: Wed, 11 Jul 2001 07:13
73 lines
2932 bytes
2932 bytes
Hi!
I have one class called DBHandler. In this class i have three ADO objects. I
also have a frame. There is one button in this frame. I got some strange
exception when pressing this button.. I should call a function in my
DBHandler called ConnectTo(AnsiString Database), and connect to a database,
whats the problem ??
.. here is my code. :
void __fastcall TForm1::Button3Click(TObject *Sender)
{
DBHandler->ConnectTo("nucleusdb");
}
bool __fastcall TDBaseHandler::ConnectTo(AnsiString Database)
{
try{
FDatabase = Database;
AnsiString Def("Provider=MSDASQL.1;Persist Security Info=False;Data
Source=");
AnsiString ConnectionString(Def + FDatabase);
MainConnection->ConnectionString = WideString(ConnectionString);
MainConnection->Open();
Query_Updater->DatabaseName = FDatabase;
Query_Updater->OpenDatabase();
XMLRecordHolder->Connection = MainConnection;
Query_XMLLoader->Connection = MainConnection;
return true;
}catch(Exception &E)
{
return false;
}
}
/wr Henrik Franz�n
Robert Vasquez <rvasquez2001@yahoo.com> wrote in message
news:3b4b1e60_2@dnews...
> Make sure you include the following...
>
> #include <ADODB.hpp>
>
> "Henrik Franz�n" <xhfr@wayne.se> wrote in message
news:3b4b121e$1_1@dnews...
> > Hi!
> > Can you create ADO components manual without dragin the icon to your
> frame.
> >
> > Like..
> > TADOConnection* MainConnection;
> > TADOTable* XMLRecordHolder;
> > TADOQuery* Query_XMLLoader;
> >
> >
> > .. I know this is a strange question. But i seem to get a rather strange
> > error when compilling. The compiler stopps at sysmec.h, line 50.
> >
> > "Declaration terminated incorrectly"
> >
> > Are the ADO componets a possible couse to this error.
> >
> > /wr Henrik Franz�n
> >
> >
> >
> >
>
>
Technical Details
Message-ID:
<3b4bfcb4$1_2@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!feeder.via.net!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3b4b121e$1_1@dnews> <3b4b1e60_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,f3596c897cc7677d X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-07-11 00:17:14 PST Reply-To: "Henrik Franz�n" <xhfr@wayne.se> From: "Henrik Franz�n" <xhfr@wayne.se> Newsgroups: borland.public.cppbuilder.database.ado References: <3b4b121e$1_1@dnews> <3b4b1e60_2@dnews> Subject: Re: create ADO componets maunal! Date: Wed, 11 Jul 2001 09:13:59 +0200 Lines: 75 Organization: Dresser Wayne X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 193.15.214.81 Message-ID: <3b4bfcb4$1_2@dnews> X-Trace: dnews 994835636 193.15.214.81 (11 Jul 2001 00:13:56 -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!feeder.via.net!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews