AddTable

ODBPPLib.IODBPP.AddTable adds an already existing table to the ObjectDatabase++ control file.
void AddTable (
   string tableName,
   uint tableId,
   string indexPath,
   uint tableLockOrder
);

Parameters

tableNamethe table name of the existing *.odt file.
tableIdthe desired tableId. Zero (0) to defaut to the next advailable Id.
indexPaththe desired index path. Blank or null to use the default, the same directoy path as the table file.
tableLockOrderthe desired table lock order value. Zero (0) for the default.

Return Values

Remarks

  • AddTable is not part of the transaction, however the database does need to be in ODBPP.EXCLUSIVE mode.
Example Use
  • C#
private void button1_Click(object sender, EventArgs e){
   try{
      OpenFileDialog dlg = new OpenFileDialog();
      DialogResult result = dlg.ShowDialog();
      if (result == DialogResult.OK) {
         ODBPPLib.ODBPP odbpp = new ODBPPLib.ODBPP();
         odbpp.OpenDatabase("C:\\My\\Database\\Control\\File.odc");
         odbpp.BeginTransaction(odbpp.EXCLUSIVE, 60000);
         odbpp.AddTable(dlg.FileName);
         odbpp.CloseDatabase();
      }
   }
   catch (Exception e1){
      MessageBox.Show(e1.Message);
   }
}

Also See

CloseTable, CreateTable, OpenTable, RemoveTable
Comments (0)Listen All
Characters left: 2500
 
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript