GetTableSchema

GetTableSchema returns the table schema of an open table.
unsigned int GetTableSchema (
   unsigned int tableID,
   CODBPP::Schema *schema,
   unsigned int *length = NULL
);

Parameters

tableIDthe table ID defining the table's handle.
schemapointer the the memory for the returning schema, NULL if unknown.
lengththe length of memory in bytes required to fit the table schema.

Return Values

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

Remarks

Example Use
int length;
char16_t *message;
CODBPP database;
CODBPP::Schema *schema;
if((error = database.OpenDatabase(TEXT("YourDatabase"))) == NO_ERROR
&& (error = database.BeginTransaction(CODBPP::EXCLUSIVE)) == NO_ERROR
&& (error = database.OpenTable(1)) == NO_ERROR
&& (error = database.GetTableSchema(1,NULL,&length)) == NO_ERROR){
   schema = (CODBPP::Schema*) new BYTE[length];
   if((error = database.GetTableSchema(1,schema)) == NO_ERROR){
      ...
   }
   delete [] (LPBYTE)schema;
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
   MessageBox(message);
database.CloseDatabase();

Also See

CreateTable, SetTableSchema
Comments (0)Listen All
Characters left: 2500
 
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript