AddTable

AddTable adds an already existing table to the ObjectDatabase++ control file.
unsigned __int64 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
  • C++
#include "ODBPP.h"

int wmain(int argc, wchar_t* argv[])
{
   unsigned __int64 error;
   CODBPP database;
   OPENFILENAME ofn;
   char16_t *message;
   if(GetOpenFileName(&ofn)){
      if((error = database.OpenDatabase(u"YourDatabase"))
      || (error = database.BeginTransaction(CODBPP::EXCLUSIVE))
      || (error = database.AddTable(ofn.lpstrFileTitle))){
         if(error && database.GetErrorMessage(&message) == NO_ERROR)
            MessageBox(message);
      }
      database.CloseDatabase();
   }
   return NO_ERROR;
}

Also See

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