![]() |
![]() |
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| DelevopersObjectDatabase++ APIAdd Object |
unsigned int AddObject ( unsigned int tableID, CODBPP::Object *object = NULL, __int64 objectID = 0 );
| 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 |
CODBPP::Object object;
struct FixedObject{
int First;
double Second;
} *fixedObject;
if((error = database.BeginTransaction()) == NO_ERROR
&& (error = database.OpenTable(1)) == NO_ERROR
&& (error = database.NewObject(1,&object)) == NO_ERROR){
fixedObject = (struct FixedObject*)object.fixed;
fixedObject->First = 456;
fixedObject->Second = 456.789;
if((error = database.AddObject(1)) == NO_ERROR)
error = database.CommitTransaction();
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
MessageBox(message);
database.EndTransaction();
Copyright © 2003-2008, Ekky Software Pty. Ltd.