if you build an application with:
Delphi 10 Seattle Update 1,
SDAC 7.2.8,
activate cached updates,
write an OnFilterRecordHandler
the application crashes with an access violation.
with delphi XE7 and SDAC 6.11.23 everything works fine.
sample code to reproduce this bug:
.pas
Code: Select all
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, DBAccess, MSAccess, Data.DB, MemDS,
Vcl.StdCtrls, Vcl.Grids, Vcl.DBGrids,
Vcl.ActnMan, Vcl.ActnColorMaps, System.Actions,
Vcl.ActnList, Vcl.Menus, Vcl.ExtCtrls, Vcl.ToolWin, Vcl.ActnCtrls, Vcl.ActnMenus;
type
TForm1 = class(TForm)
MainQ: TMSQuery;
MSConnection1: TMSConnection;
MainQfield: TIntegerField;
procedure MainQSimpleFilterRecord(DataSet: TDataSet; var Accept: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MainQSimpleFilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
inherited;
accept := MainQfield.AsInteger = 0;
end;
end.
Code: Select all
object Form1: TForm1
Left = 0
Top = 0
ClientHeight = 201
ClientWidth = 304
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = True
PixelsPerInch = 96
TextHeight = 13
object MainQ: TMSQuery
Connection = MSConnection1
SQL.Strings = (
'select 1 as field'
''
'')
CachedUpdates = True
Filtered = True
OnFilterRecord = MainQSimpleFilterRecord
Active = True
object MainQfield: TIntegerField
FieldName = 'field'
end
end
object MSConnection1: TMSConnection
Database = 'master'
Authentication = auWindows
Server = 'localhost'
Connected = True
LoginPrompt = False
end
end
Thanks, Ludek.