AddObject
AddObject adds the object currently handled by a table, using NewObject if there is not currently an object.unsigned int AddObject ( unsigned int tableID, CODBPP::Object *object = NULL, __int64 objectID = 0 );
Parameters
| tableID | The table ID defining the table's handle. |
| object | Returns the newly added object's values. |
| objectID | The ID required for the new object, 0 for the next available |
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
CODBPP::Object object;
struct FixedObject{
int First;
double Second;
} *fixedObject;
if((error = database.BeginTransaction()) == NO_ERROR
&& (error = database.OpenTable(FIRST_TABLE)) == NO_ERROR
&& (error = database.NewObject(FIRST_TABLE,&object)) == NO_ERROR){
fixedObject = (struct FixedObject*)object.fixed;
fixedObject->First = 456;
fixedObject->Second = 456.789;
if((error = database.AddObject(FIRST_TABLE)) == NO_ERROR)
error = database.CommitTransaction();
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
MessageBox(message);
database.EndTransaction();

