TVirtualTable throws 'Illegal filter expression'

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cis-wurzen
Posts: 75
Joined: Tue 04 Jan 2005 10:26

TVirtualTable throws 'Illegal filter expression'

Post by cis-wurzen » 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

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;
* Run and press button.

Versions: Delphi 2010 ODAC 6.90.0.57

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Fri 28 May 2010 06:27

Hello

Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next (6.90.0.59) ODAC build.

Now you can use the expression VT.Filter := 'FIELD="''''X"' instead of the expression VT.Filter := 'FIELD=' + QuotedStr(#39 + 'X')

Post Reply