NewObject

NewObject create a new object buffer for the give table handle.
unsigned int NewObject (
   unsigned int tableID,
   CODBPP::Object *object = NULL,
   unsigned int variableLength = 0
);

Parameters

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

Return Values

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

Remarks

Example Use
#define FIRST_TABLE 1
struct Field{
   int first;
   double second;
} *field;
char16_t *str = TEXT("new field value"), *message;
CODBPP::Object object;
if((error = database.BeginTransaction()) == NO_ERROR
&& (error = database.OpenTable(FIRST_TABLE)) == NO_ERROR
&& (error = databse.NewObject(FIRST_TABLE,&object,wcslen(str))) == NO_ERROR){
   field = (stuct Field*)object.fixed;
   field->first = 345;
   field->second = 678.9;
   wcscpy((char16_t*)object.variable,str);
   if((error = database.AddObject(FIRST_TABLE)) == NO_ERROR)
      error= database.CommitTransaction();
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
   MessageBox(message);
database.EndTransaction();

Also See

AddObject, DeleteObject, ReadObject, RewriteObject
Comments (0)Listen All
Characters left: 2500
 
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript