GetTableSchema
GetTableSchema returns the table schema of an open table.unsigned __int64 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
- C++
#include "ODBPP.h" int wmain(int argc, wchar_t* argv[]) { int length; unsigned __int64 error; const char16_t *message; CODBPP database; CODBPP::Schema *schema; if((error = database.OpenDatabase(u"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(); return NO_ERROR; }
Also See
CreateTable, SetTableSchemaListen All
Comments (0)