Page 1 of 1

Exception in CachedUpdates ApplyUpdates

Posted: Fri 11 May 2012 16:41
by JGordon
I have code that deletes the detail records in a master/detail set of tables. The detail table is in CachedUpdate and I have code that reads:

with Tbl do
begin
DisableControls;
try
First;
while not EOF do
Delete;
if CachedUpdates and UpdatesPending then
begin
ApplyUpdates;
CommitUpdates;
end;
finally
EnableControls;
end;
end;

This gives me an exception in the ApplyUpdates. The MemData.pas, in the ApplyUpdates procedure on line 7205 which reads

if OldCurrentItem.Flag = flUsed then
CurrentItem := OldCurrentItem;

Then OldCurrentItem is nil and so it causes a problem. If I put an:

if OldCurrentItem<>nil

before the lines, it seems to work. Is there any problem with doing this?

Thanks,

Re: Exception in CachedUpdates ApplyUpdates

Posted: Mon 14 May 2012 07:27
by AndreyZ
Hello,

We fixed the bug at executing ApplyUpdates in SDAC 6.1.5 . To solve the problem, you should upgrade SDAC at least to this version.