Board index » delphi » Problem with SQL

Problem with SQL

I have an archive and I want research a record with SQL. I wrote:
Query1->SQL->Text="SELECT * FROM mytable WHERE "+"Cognome LIKE"+"
'%"+Edit1->Text+"%'";
If in Edit1->Text there is the caracter * ' * an error message appear.
How can I resolve?
Thanks for attention.
 

Re:Problem with SQL


Have a look at the QuotedStr function.
Quote
Gerla Giuseppe wrote in message <887485$gt...@bornews.borland.com>...
>I have an archive and I want research a record with SQL. I wrote:
>Query1->SQL->Text="SELECT * FROM mytable WHERE "+"Cognome LIKE"+"
>'%"+Edit1->Text+"%'";
>If in Edit1->Text there is the caracter * ' * an error message appear.
>How can I resolve?
>Thanks for attention.

Re:Problem with SQL


Use QuotedStr.

John

Other Threads