
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
| tableName | the table name of the existing *.odt file. |
| tableID | the desired tableID. |
| indexPath | the desired index path. |
| tableLockOrder | the 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, RemoveTableListen All
Comments (0)

