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
controlFileName | u'\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, OpenDatabaseListen All
Comments (0)