CreateDatabase

CreateDatabase creates a new ObjectDatabase Control file (*.odc) that contains all the information required control all the tables and transactions within the database.
unsigned __int64 CreateDatabase (
   const char16_t* controlFileName
);

Parameters

controlFileNameu'\0' terminating string that contains the required path for the control file.

Return Values

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

Remarks

  • This methos also opens the database for use.
Example Use
  • C++
#include "ODBPP.h"

int wmain(int argc, wchar_t* argv[])
{
   unsigned __int64 error;
   const char16_t *message;
   CODBPP database;
   CODBPP::Schema schema;
   //initialize table schema to your requirements
   if((error = database.CreateDatabase(u"C:\YourDatabase")) == NO_ERROR
   && (error = database.BeginTransaction(CODBPP::EXCLUSIVE)) == NO_ERROR
   && (error = database.CreateTable(&schema)) == NO_ERROR){
      ...
   }
   if(error && database.GetErrorMessage(&message) == NO_ERROR)
      MessageBox(message);
   database.EndTransaction();
   return NO_ERROR;
}

Also See

CloseDatabase, OpenDatabase
Listen All
Comments (0)
Characters left: 2500
 
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript