Icon View Incident Report

Serious Serious
Reported By: Kishore Sharma
Reported On: 7/25/2007
For: Version 1.04 Build 6
# 2423 Using NOT in a Filter Expression Can Cause AV

We have a Table and it have 3 cols :

Col1 as Integer,
Col2 as String
Col3 as String

Add 3 buttons in a form. Following is the code for all the buton click events.

On click of Button3 we are getting Access violation after Button1 & Button2.

procedure TForm1.Button1Click(Sender: TObject);
begin
  Table1.OpenInMemory;   // This will open Table1 in memory.
                         // It is linked with a Memory DB.
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Table1.Filter   := '( (not Col1 in (1, 2)) and '+
                     '(Col2 <> ''cc'') )  and '+
                     '(Col3 <> ''dd'')'; // AV

//Table1.Filter := '( (not Col1 in (1, 2)) and (Col2 <> ''cc'') )'; // Works
  Table1.Filtered := True;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Table1.Active := False;
end;



Comments Comments and Workarounds
Re-phrasing the NOT Col1 in (1, 2) expression as Col1 NOT IN (1, 2) is the workaround.


Resolution Resolution
Fixed Problem on 7/25/2007 in version 1.05 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image