GetErrorMessage

GetErrorMessage returns any formated error string if available.
unsigned __int64 GetErrorMessage (
   char16_t **message
);

Parameters

messagean address of a pointer to receive the pointer to the error message.

Return Values

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

Remarks

  • ObjectDatabase++ deletes any memory used in this method, do not call delete [] after this method has been called.
Example Use
  • C++
#include "ODBPP.h"

#define FIRST_TABLE 1

int wmain(int argc, wchar_t* argv[])
{
   unsigned __int64 error;
   const char16_t *message;
   CODBPP database;
   if((error = database.OpenDatabase(u"YourDatabase")) == NO_ERROR
   && (error = database.BeginTransaction()) == NO_ERROR
   && (error = database.OpenTable(FIRST_TABLE)) == NO_ERROR
      //Adds an empty object into the table
   && (error = database.NewObject(FIRST_TABLE)) == NO_ERROR
   && (error = database.AddObject(FIRST_TABLE)) == NO_ERROR)
      error = database.CommitTransacion();
   if(error && database.GetErrorMessage(&message) == NO_ERROR)
      MessageBox(message);
   //will end transaction, close tables and release all memory
   database.CloseDatabase();
   return NO_ERROR;
}

Also See

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