TVirtualTable throws 'Illegal filter expression'
Posted: Wed 26 May 2010 16:29
TVirtualTable throws 'Illegal filter expression' if value starts with an apostrophe (aka #39 or Chr(39)).
Steps to reproduce:
* Create a new VCL-App.
* Drop a TVirtualTable on Form1. Name it VT.
* Create one field named FIELD with type ftString.
* Fill Data with two records. One with [A], second with ['X] (without the brackets)
* Put a Button on Form1
* Enter code
* Run and press button.
Versions: Delphi 2010 ODAC 6.90.0.57
Steps to reproduce:
* Create a new VCL-App.
* Drop a TVirtualTable on Form1. Name it VT.
* Create one field named FIELD with type ftString.
* Fill Data with two records. One with [A], second with ['X] (without the brackets)
* Put a Button on Form1
* Enter code
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
VT.Open;
VT.Filter := 'FIELD=' + QuotedStr('A');
VT.Filtered := True; // works
VT.Filtered := False;
VT.Filter := 'FIELD=' + QuotedStr(#39 + 'X');
VT.Filtered := True; // crashes
end;
Versions: Delphi 2010 ODAC 6.90.0.57