Cached updates, filter, moving position in datalink, user data input -> access violation in SDAC
Posted: Tue 05 Jul 2005 13:49
Hi,
I'm having trouble with the newest version of SDAC. I need some special drawing in TDBGrid - I've written an TDBGrid descendant and overriden the Paint method to scan all the rows visible in grid:
procedure TMyDBGrid.Paint;
var
i, oldactiverec: integer;
begin
oldactiverec := Datalink.ActiveRecord;
try
for i := 0 to Datalink.BufferCount - 1 do begin
Datalink.ActiveRecord := i;
if datasource.dataset.fields[0].AsVariant = '1' then begin
// some processing
end;
end;
finally
Datalink.ActiveRecord := oldactiverec;
end;
inherited;
end;
It worked fine using BDE and it works also fine using SDAC, but an access vilotation (sometimes only an assert) occurs somewhere in SDAC units under following circumstances:
1. the TMSQuery shown in the grid has active cached updates
2. the TMSQuery is filtered and some rows are because of this filter not visible
3. user begins to the change data in the grid - immediately after keypress this AV occurs
Do you have an idea? I could send you the example.
Thanks.
I'm having trouble with the newest version of SDAC. I need some special drawing in TDBGrid - I've written an TDBGrid descendant and overriden the Paint method to scan all the rows visible in grid:
procedure TMyDBGrid.Paint;
var
i, oldactiverec: integer;
begin
oldactiverec := Datalink.ActiveRecord;
try
for i := 0 to Datalink.BufferCount - 1 do begin
Datalink.ActiveRecord := i;
if datasource.dataset.fields[0].AsVariant = '1' then begin
// some processing
end;
end;
finally
Datalink.ActiveRecord := oldactiverec;
end;
inherited;
end;
It worked fine using BDE and it works also fine using SDAC, but an access vilotation (sometimes only an assert) occurs somewhere in SDAC units under following circumstances:
1. the TMSQuery shown in the grid has active cached updates
2. the TMSQuery is filtered and some rows are because of this filter not visible
3. user begins to the change data in the grid - immediately after keypress this AV occurs
Do you have an idea? I could send you the example.
Thanks.