Page 1 of 1

Master + Detail CachedUpdates Problem

Posted: 25.04.2007, 03:53
by arch-vile
Hello..

This is a first time i using CachedUpdates=True in my program. :)
Now i try make master - detail program with TZQuery..
Master : beli
Detail : beli_item
DM : DataModule

I have a problem when click save button. Data on detail dataset never post to database. below is a quoting my code :

try
DM.ZConnection.StartTransaction;
if beli.UpdatesPending or beli_item.UpdatesPending then
begin
beli.ApplyUpdates;
beli_item.ApplyUpdates;
end;
DM.ZConnection.Commit;
beli.CommitUpdates;
beli_item.CommitUpdates;
except
DM.ZConnection.Rollback;
if beli_item.UpdatesPending then beli_item.CancelUpdates;
if beli.UpdatesPending then beli.CancelUpdates;
raise;
end;

Any clue?

fyi: I used Delphi 7+Zeos.6.6.0-beta+MySQL 4.1.9

thx..
arifin

Posted: 30.05.2007, 00:41
by casanova_frank
How do you assign data to the fields? DB-Aware controls or code?
Are you calling Post somewhere before ApplyUpdates?