AbortTransaction

ODBPPLib.IODBPP.AbortTransaction returns the current transaction to its original state, it could be the state at the beginning of the transaction or after the last CommitTransaction.
void AbortTransaction(
   bool releaseObjectLocks
);

Parameters

releaseObjectLocks If this is set to false, this method acts as an unsave point, undoing all adds, edits and deletes, but not releasing any object locks.

Return Value

Remarks

Example Use
  • C#
public static uint FIRST_TABLE = 1;
private void button1_Click(object sender, EventArgs e)
   try{
      ODBPPLib.ODBPP odbpp = new ODBPPLib.ODBPP();
      odbpp.OpenDatabase("C:\\My\\Database\\Control\\File.odc");
      odbpp.BeginTransaction(odbpp.SHARED, 60000);
      odbpp.OpenTable(FIRST_TABLE);
      while(true){
         ODBPPLib.DatabaseObject obj = odbpp.NewObject(FIRST_TABLE);
         obj.WriteField("First", 456);
         obj.WriteField("Second", 456.789);
         obj = odbpp.AddObject(FIRST_TABLE,0);
         if(obj.Id > 30){
            odbpp.AbortTransaction(true);
            break;
         }
         if(obj.Id > 25) break;
      }
      odbpp.CommitTransaction(true);
      odbpp.EndTransaction();
   }
   catch (Exception e1){
      MessageBox.Show(e1.Message);
   }
}

Also See

BeginTransaction, CommitTransaction, EndTransaction
 

Contact Ekky Software

All around the world Ekky Software is contactable seven days of the week by submitting the following details.

Thank you for your time and interest.
Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage Texas Business Software ObjectDatabase++ TScript Ekky Software Homepage Texas Business Software ObjectDatabase++ TScript