AddTable

AddTable adds an already existing table to the ObjectDatabase++ control file.
unsigned int AddTable (
   const char16_t *tableName,
   unsigned int tableID = 0,
   const char16_t *indexPath = NULL,
   unsigned int tableLockOrder = 0
);

Parameters

tableNamethe table name of the existing *.odt file.
tableIDthe desired tableID.
indexPaththe desired index path.
tableLockOrderthe desired table lock order value.

Return Values

If the method succeeds, the return value is zero else see error codes for more details.

Remarks

  • AddTable is not part of the transaction, however the database does need to be in exclusive mode.
Example Use
CODBPP database;
OPENFILENAME ofn;
char16_t *message;
if(GetOpenFileName(&ofn)){
   if((error = database.OpenDatabase(TEXT("YourDatabase")))
   || (error = database.BeginTransaction(CODBPP::EXCLUSIVE))
   || (error = database.AddTable(ofn.lpstrFileTitle))){
      if(error && database.GetErrorMessage(&message) == NO_ERROR)
         MessageBox(message);
   }
   database.CloseDatabase();
}

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