how to rollback an transaction
Posted: Thu 03 Sep 2009 14:13
As far as I know this code is using an transaction:
But when the commit failed, you have to rollback the transaction.
How will I do this in code? The table will be opened, updated and closed in a class.
Code: Select all
with FKostenQuery do
begin
Connection.StartTransaction;
Edit;
FieldByName('bedrag_uitgerekend').AsFloat := ubedrag;
FieldByName('bedrag_gewijzigd').AsFloat := ubedrag;
Post;
Connection.Commit;
end;
How will I do this in code? The table will be opened, updated and closed in a class.