Article View: borland.public.cppbuilder.database.ado
Article #4448Re: Params and ADOQuery
From: Marshall
Date: Wed, 02 Jan 2002 07:39
Date: Wed, 02 Jan 2002 07:39
41 lines
2040 bytes
2040 bytes
Just to clarify a bit:
ADOQuery3->SQL->Add("INSERT INTO Author(Author_Code, Author_Name,
Author_Address) SELECT ");
ADOQuery3->SQL->Add("' :ACode ' AS expr1,");
ADOQuery3->SQL->Add("' :AName ' AS expr2,");
ADOQuery3->SQL->Add("' :AAddress ' AS expr3;");
ADOQuery3->Parameters->ParamByName("ACode")->Value = ACode;
ADOQuery3->Parameters->ParamByName("AName")->Value = AName;
ADOQuery3->Parameters->ParamByName("AAddress")->Value = AAddr;
is the code im using and the error i get is:
<Project Name.exe> raised exception class EDatabaseError with message
'Parameter 'ACode' not found'.
cheers
--
M
"Marshall" <adworx@ihug.co.nz.spammenot> wrote in message
news:3c32b114_2@dnews...
> When assigning values to parameters in ADOQuery I use
>
> ADOQuery3->Parameters->ParamByName("ACode")->Value = editACode->Text;
> or
> ADOQuery3->Parameters->ParamByName("ACode")->Value =
> editACode->Text.c_str();
>
> both of whihc give me a error of being unable to define the param.
> the only way I've found to get around this is to copy the edit boxes value
> into a char array and then set the param to that.
> any work arounds or is this just me?
>
> ta
>
> --
> M
>
>
Technical Details
Message-ID:
<3c32b92d_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3c32b114_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,4aff3e15a2c4b841 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-01-01 23:45:23 PST From: "Marshall" <adworx@ihug.co.nz.spammenot> Newsgroups: borland.public.cppbuilder.database.ado References: <3c32b114_2@dnews> Subject: Re: Params and ADOQuery Date: Wed, 2 Jan 2002 20:39:08 +1300 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 203.173.230.153 Message-ID: <3c32b92d_2@dnews> X-Trace: dnews 1009957165 203.173.230.153 (1 Jan 2002 23:39:25 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews