Master + Detail CachedUpdates Problem
Posted: 25.04.2007, 03:53
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
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