ZQuery in transaction
Posted: 22.02.2017, 09:24
Hello
I have two table : table1 and table2
ZQuery1 = table1
ZQuery2 = table2
After post a new record in ZQuery1 (table1) i'd like to modify something in ZQuery2 (table2) in ZQuery1.afterpost event.
Is it possible to do it in one transaction ?
And rollback the changes in ZQuery1 and ZQuery2 if something wrong happen in ZQuery2 ?
ZQuery1.table1afterpost(.........)
begin
ZQuery2.Edit;
ZQuery2FiledX.value:='xxx';
ZQuery2.Post; //if happen something wrong here what can i do to rollback all changes in ZQuery1 ?
end;
thank you in advance
Attila
I have two table : table1 and table2
ZQuery1 = table1
ZQuery2 = table2
After post a new record in ZQuery1 (table1) i'd like to modify something in ZQuery2 (table2) in ZQuery1.afterpost event.
Is it possible to do it in one transaction ?
And rollback the changes in ZQuery1 and ZQuery2 if something wrong happen in ZQuery2 ?
ZQuery1.table1afterpost(.........)
begin
ZQuery2.Edit;
ZQuery2FiledX.value:='xxx';
ZQuery2.Post; //if happen something wrong here what can i do to rollback all changes in ZQuery1 ?
end;
thank you in advance
Attila