GetTableSchema

GetTableSchema returns the table schema of an open table.
unsigned __int64 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
  • 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, SetTableSchema
Listen All
Comments (0)
Characters left: 2500
 
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript