For example, the code below works flawless:
Code: Select all
procedure TForm1.SearchEditChange(Sender: TObject);
var
filterQuery : String;
begin
if Length(SearchEdit.Text) >= 3 then
begin
TestTable.FilterOptions:= [foCaseInsensitive];
filterQuery := 'Name LIKE ' + QuotedStr('*' + SearchEdit.Text + '*') +
' OR Street LIKE ' + QuotedStr('*' + SearchEdit.Text + '*') +
//' OR Nr LIKE ' + QuotedStr('*' + SearchEdit.Text + '*') +
' OR Town LIKE ' + QuotedStr('*' + SearchEdit.Text + '*') +
' OR Phone LIKE ' + QuotedStr('*' + SearchEdit.Text + '*') +
'';
TestTable.Filter := filterQuery;
TestTable.Filtered := true;
end
else
begin
TestTable.Filtered:= False;
end
end;
In this image the problem is clearly visible:
Here is a download link to the Delphi 2010 test project including the database:
http://dl.dropbox.com/u/32493275/ZEOSTEST/ZEOSTEST.zip