 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Pieter Guest
|
Posted: Mon Jul 11, 2005 4:09 pm Post subject: Parameter question |
|
|
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
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Mon Jul 11, 2005 7:44 pm Post subject: Re: Parameter question |
|
|
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 (AT) nomail (DOT) com> сообщил/сообщила в новостях следующее:
news:42d299b9$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
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
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|