ReadObject

RewriteObject is used in conjunction with ReadObject to change the values of the object.
unsigned __int64 RewriteObject (
   unsigned int tableID,
   CODBPP::Object *object = NULL
);

Parameters

tableIDthe table ID defining the table's handle.
objectfor the returned object addresses

Return Values

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

Remarks

Example Use
  • C++
#include "ODBPP.h"

#define TABLE_FIRST 1

struct FixedObject{
   int First;
   double Second;
} *fixedObject;

int wmain(int argc, wchar_t* argv[])
{
   unsigned __int64 error;
   CODBPP database;
   CODBPP::Object object;
   const char16_t *userName = u"UserName", *message;
   if((error = database.BeginTransaction()) == NO_ERROR
   && (error = database.OpenTable(TABLE_FIRST)) == NO_ERROR
   && (error = database.ReadObject(TABLE_FIRST,
             CODBPP::EQUALTO,&object,1,userName)) == NO_ERROR){
      fixedObject = (struct FixedObject*)object.fixed;
      fixedObject->First = 123;
      fixedObject->Second = 456.789;
      if((error = database.RewriteObject(TABLE_FIRST)) == NO_ERROR)
         error = database.CommitTransaction();
   }
   if(error && database.GetErrorMessage(&message) == NO_ERROR)
      MessageBox(message);
   database.EndTransaction();
   return NO_ERROR;
}

Also See

AddObject, DeleteObject, NewObject, ReadObject, RestoreObject
Listen All
Comments (0)
Characters left: 2500
 
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript