I use TClientDataSetas a table in memory and must apply a filter with many conditions.
For example, under conditions 400, ORI get an access violation when I try to turn on the filter.
Access Violation at address 4DAEDC76 in the "midas.dll" module. Read the address 00000034.
An exception occurs here:
procedure TCustomClientDataSet.AddExprFilter(const Expr: Widestring; Options: TFilterOptions);
begin
if FExprFilter <> nil then FDSCursor.DropFilter(FExprFilter);
if Expr <> '' then
with TExprParser.Create(Self, Expr, Options, [poExtSyntax], '', nil, FieldTypeMap, True) do
try
CheckProviderEOF;
Check(FDSCursor.AddFilter(FilterData, DataSize, FExprFilter)); // ** AV HERE
finally
Free;
end;
end;
Is this a component error or limitation of the midas.dll file? I tested this behavior in these versions of midas:> = 15 and <= 23
I am using Delphi XE. Code example:
procedure TForm41.Button1Click(Sender: TObject);
var
I: Integer;
FilterStr: string;
begin
FilterStr := '(vehicleId = -1)';
//It is just an example, the original code I can have any integer number.
for I := 0 to 400 do //If I change the limit value to 40 for example, it works.
FilterStr := FilterStr + ' or (vehicleId = ' + IntToStr(I) + ')';
ClientDataSet1.Filter := FilterStr;
ClientDataSet1.Filtered := True;
ClientDataSet1.CreateDataSet; //Error here
end;
I already tried using the IN statement, but getting the same error.
I did not find links about this situation on the Internet.