dbx4mysql

Examples

Previous 

How to declare a transaction identifier:

FTransactionID: TTransactionDesc;

How to fill the required properties:

FTransactionID.TransactionID:= 1;
FTransactionID.IsolationLevel:= xilREADCOMMITTED;

How to start a transaction:

SQLConnection1.StartTransaction(FTransactionID);

How to run some queries:

SQLQuery1.ExecSQL;
SQLQuery2.Open;

How to end the transaction:

if SQLConnection1.InTransaction then
  begin
    if MessageDlg('Commit',mtConfirmation,mbYesNoCancel,0)=mrYes then
      SQLConnection1.Commit(FTransactionID)
    else
      SQLConnection1.Rollback(FTransactionID);
  end;