Article View: borland.public.cppbuilder.database.ado
Article #5100Re: ADO connect..!?
From: Arnie Mauer
Date: Wed, 11 Jul 2001 13:04
Date: Wed, 11 Jul 2001 13:04
92 lines
3407 bytes
3407 bytes
You can't mix BDE (TQuery) and ADO like that.
Use a TADOQuery. It's ParamByName semantics are different. Use:
TADOQuery * q;
...
q->SQL->Add( " ... WHERE X = :x" );
q->Parameters->ParamByName( "x" )->Value = whatever.
Note that the TADOQuery ParamByName() doesn't have "AsXxxxx"
properties. It uses the Variant 'Value';
Hope this helps.
- Arnie
"Henrik Franz�n" <xhfr@wayne.se> wrote in message news:3b4c0a6b_1@dnews...
> TADOConnection *MainConnection;
> TADOTable *XMLRecordHolder;
> TADOQuery *Query_XMLLoader;
> TQuery *Query_Updater;
>
> I ADOQuery don't seem to support ParamByName().. .. or SQL server
conflicts
> with ADOQuery's Parameters.. hum I dono whats wrong. i just want it to
> work.. ..
> '
>
>
> Formentz <francesco@leotron.com> wrote in message news:3b4c04ea_2@dnews...
> > What is Query_Updater which you assign DatabaseName?
> > A BDE TQuery? Why don't you use TADOQuery?
> >
> > Ciao
> > Formentz
> > "Henrik Franz�n" <xhfr@wayne.se> ha scritto nel messaggio
> > news:3b4bf906$1_2@dnews...
> > > 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;
> > > }
> > >
> > > }
> > >
> > >
> > >
> > > I hope someone can help me!
> > >
> > > /wr Henrik Franz�n
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID:
<3b4c4ee6_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b4bf906$1_2@dnews> <3b4c04ea_2@dnews> <3b4c0a6b_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,411507ca9a8fef65 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-07-11 06:10:58 PST From: "Arnie Mauer" <arnie@marketexpert.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3b4bf906$1_2@dnews> <3b4c04ea_2@dnews> <3b4c0a6b_1@dnews> Subject: Re: ADO connect..!? Date: Wed, 11 Jul 2001 09:04:38 -0400 Lines: 94 Organization: VRMS X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 209.140.211.97 Message-ID: <3b4c4ee6_1@dnews> X-Trace: dnews 994856678 209.140.211.97 (11 Jul 2001 06:04:38 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!dnews