Article View: borland.public.cppbuilder.database.ado
Article #696Re: Parameter question
From: Viatcheslav V. Vassiliev
Date: Mon, 11 Jul 2005 19:44
Date: Mon, 11 Jul 2005 19:44
35 lines
2026 bytes
2026 bytes
ParamByName recognizes parameters in form :paramName - select ID from
tblClient where clientName = :name. Try qry->Parameters->Refresh() after
assigning SQL, you may want to set ParamCheck = false if you do not use
:paramName notation. BTW, your syntax is for MS Jet (MS Access) only.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Pieter" <pieter@nomail.com> �������/�������� � �������� ���������:
news:42d299b9$1@newsgroups.borland.com...
>
> Hi,
>
> I use the following code:
>
> String SQL = "PARAMETERS name Text(255);"
> SQL += "SELECT ID FROM tblClient WHERE clientName = name";
> qry->SQL->Clear();
> qry->SQL->Add(SQL);
> qry->Parameters->ParamByName("name") = "Test";
>
> qry->ExecSQL();
>
> When I execute this code I get the following error:
> Parameter 'name' not found
>
> What I am doing wrong?
>
> Thanks in advance
>
Technical Details
Message-ID:
<42d2cc04@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42d299b9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,86b1cc438e982add X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <42d299b9$1@newsgroups.borland.com> Subject: Re: Parameter question Date: Mon, 11 Jul 2005 23:44:05 +0400 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 85.93.138.132 Message-ID: <42d2cc04@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1121111044 85.93.138.132 (11 Jul 2005 12:44:04 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail