🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Usage of Parameters in ADOQuery

#1021
From: Matt Jacobs
Date: Thu, 09 Dec 2004 16:35
22 lines
1765 bytes
"Patrick Wong" <patrickwong@computer.org> wrote:

>Dear all,
>
>Are parameters only workable in "where" part of a ADOQuery's SQL statement?
>I have the following code that does not work:
>
>ADOQuery1->Close();
>ADOQuery1->SQL->Clear();
>ADOQuery1->SQL->Add("select * from :TBL_NAME where id=':REC_ID'");
>ADOQuery1->Parameters->ParamByName("TBL_NAME")->Value = EditTblName->Text;
>ADOQuery1->Parameters->ParamByName("REC_ID")->Value = EditRecID->Text;
>AnsiString chkStr1 = ADOQuery1->Parameters->ParamByName("TBL_NAME")->Value;
>AnsiString chkStr2 = ADOQuery1->Parameters->ParamByName("REC_ID")->Value;
>AnsiString chkStr3 = ADOQuery1->Parameters->ParseSQL(ADOQuery1->SQL->Text,
>true);
>ADOQuery1->Open();

It's been a while, but I don't think :TBL_NAME can be a parameter
marker.

Also, where id=':REC_ID' should be where id=:REC_ID
Technical Details
Message-ID: <7jvgr0hqqqbvc67dkusohkln2mi57mmjqb@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41a81560$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,4778097d36f5a178
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Matt Jacobs <noyb@noyb.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Usage of Parameters in ADOQuery
Date: Thu, 09 Dec 2004 08:35:40 -0800
Reply-To: __noyb@noyb.com
Message-ID: <7jvgr0hqqqbvc67dkusohkln2mi57mmjqb@4ax.com>
References: <41a81560$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.23.153.114
X-Trace: newsgroups.borland.com 1102610114 24.23.153.114 (9 Dec 2004 08:35:14 -0800)
Lines: 23
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail