Home Home

GetTableSchema

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

Parameters

tableID The table ID defining the table's handle.
schema Pointer the the memory for the returning schema, NULL if unknown
length The 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(_T"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

Copyright © 2003-2008, Ekky Software Pty. Ltd.