Delphi Examples: DbiEndTran

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiEndTran

Return to chapter overview

End the specified transaction:

Delphi users should use the TDataBase.Commit,TDataBase.RollBack methods rather than directly calling DbiEndTran. These methods are defined as:

procedure TDataBase.Commit;

procedure TDataBase.RollBack;

The following code ends a transaction on a TDataBase object called DataBase1 and rolls back changes to the pre-transaction state:

{ cancels all modifications made to DataBase1 since last call to StartTransaction }

 DataBase1.RollBack

The following code ends a transaction on a TDataBase object called DataBase1 and commits changes to the table:

{ commits all modifications made to DataBase1 since last call to StartTransaction. }

 DataBase1.Commit;

end;

End the master/detail link and close the associated cursors. This example uses the following input:

 fDbiEndLinkMode(hMas, hDet);

 

The procedure is defined as:

procedure fDbiEndLinkMode(var hMasCur, hDetCur: hDBICur);

begin

 Check(DbiUnlinkDetail(hDetCur));

 Check(DbiEndLinkMode(hMasCur));

 Check(DbiEndLinkMode(hDetCur));

 Check(DbiCloseCursor(hMasCur));

 Check(DbiCloseCursor(hDetCur));

end;