Error dataset.post when cachedupdates = true
Posted: 30.03.2015, 16:22
Hi,
I am using Zeos Zeos 7.1.3-stable with Delphi 2010 and Firebird 2.5. I have the following code:
First I create a new record in the database. Then I edit the same record. On the second ZQuery1.Post I get the following error:
'Cannot update a deleted row'. If CachedUpdates = false there is no error. The problem is in the commitupdates. When i do not execute the commitupdates there is no error. Does anyone know what the problem is?
Thanks in advance.
Kind regards,
Kees
I am using Zeos Zeos 7.1.3-stable with Delphi 2010 and Firebird 2.5. I have the following code:
Code: Select all
ZQuery1.CachedUpdates := true;
ZQuery1.Open;
ZQuery1.First;
if not ZQuery1.Eof then
begin
Zquery1.Insert;
Zquery1.FieldByName('ID').AsInteger := 1;
Zquery1.FieldByName('MACHINECODE').AsString := 'A01';
ZQuery1.Post;
if ZQuery1.UpdatesPending then
begin
ZQuery1.ApplyUpdates;
ZQuery1.CommitUpdates;
end;
Zquery1.Edit;
Zquery1.FieldByName('MACHINECODE').AsString := 'A02';
ZQuery1.Post;
if ZQuery1.UpdatesPending then
begin
ZQuery1.ApplyUpdates;
ZQuery1.CommitUpdates;
end;
end;
'Cannot update a deleted row'. If CachedUpdates = false there is no error. The problem is in the commitupdates. When i do not execute the commitupdates there is no error. Does anyone know what the problem is?
Thanks in advance.
Kind regards,
Kees