Skip to Content
0
Former Member
Nov 02, 2015 at 03:06 PM

SQL Like sentence only works 1 time on ADS12

34 Views

Hi all,

on ADS12 doesn't works the SQL "Like" sentence, well to be correct, only works the first time you invoke it.

From Delphi XE8,

I have an EditText, a DbGrid and a Button to search in the Country.ADT table from ADTDemoData in a Remote Server.

The button OnClick procedure is that:

procedure TForm5.Button1Click(Sender: TObject);

begin

AdsQuery1.Close;

AdsQuery1.SQL.Clear;

AdsQuery1.SQL.Add('SELECT * FROM COUNTRY WHERE NAME LIKE :paramvalue');

AdsQuery1.Params[0].Value := '%'+Edit1.Text+'%';

AdsQuery1.Open;

end;

When I press the button "Search", looking for countries with "en" in their name, the DbGrid shows "Argentina" and "Venezuela". CORRECT!!!!😊

But, if I repeat the search, looking for countries with "ol" in their name, the DbGrid shows again "Argentina" and "Venezuela".

In fact the search won't works anymore.😔

I test it in my old server with ADS7 and works fine.

I test it with .DBF files and doesn't works.

Why the SELECT LIKE sentence only works 1 time?

Does it changed something in the way I have to invoke the SELECT LIKE sentence?

I need help.

Thanks a lot

Cheers from Barcelona

Eugeni.

Attachments

Captura.PNG (27.9 kB)