Class ODBPP::Field

Used to represent a field within the table schema.
class Field{
public:
   enum CODBPP::DataType type;
   unsigned int offset;
   unsigned int length;
   unsigned int subFieldCount;
   char16_t *name;
   Field *subFields;
};

Members

typevalue for the field's data type.
offsetoffset from the begining of the object buffer, or the offset of the variable length fields.
lengththe length of the field or the expected length for variable fields - in bytes.
subFieldCountcontains a count of the next fields that are a part of the sub-table.
name'' terminating string for the field name.
subFieldsFor type CODBPP::SUB_TABLE, an array fields that make the sub table

Remarks

Example Use
CODBPP database;
CODBPP::Schema schema;
CODBPP::Field fields[3];
memset(&schema,0,sizeof(CODBPP::Schema));
schema.tableName = TEXT("Table Name");
schema.fieldCount = 3;
schema.fields = &fields;
memset(schema.fields,0,schema.fieldCount * sizeof(CODBPP::Field));
schema.fields[0].type = CODBPP::UINT32;
schema.fields[0].name = TEXT("First");
schema.fields[1].type = CODBPP::FLOAT64;
schema.fields[1].name = TEXT("Second");
schema.fields[2].type = CODBPP::ASTR;
schema.fields[2].name = TEXT("Third");
if(database.OpenDatabase(TEXT("YourDatabase")) == NO_ERROR){
   if((error = database.BeginTransaction(CODBPP::EXCLUSIVE)) == NO_ERROR){
      if((error = database.CreateTable(&schema)) == NO_ERROR){
         ...
      }
   }
   if(error && database.GetErrorMessage(&message) == NO_ERROR)
      MessageBox(message);
   database.EndTransaction();
}

Also See

CreateTable, GetTableSchema, SetTableSchema
Comments (0)Listen All
Characters left: 2500
 

Contact Ekky Software

Thank you for your time and interest.
Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript