Board index » cppbuilder » Can't create a table at runtime
rob kemp
![]() CBuilder Developer |
Can't create a table at runtime2004-01-17 05:23:56 AM cppbuilder99 Hi all, I am trying to create a table at runtime using the following code. I have already created the database (db) but when I execute the code I get BDEEngineError with message "Number is out of range"....what number? I tried to change the size of each field but that didn't solve the problem What am I missing thanks in advance Rob TTable* table = new TTable(this); table->DatabaseName="db"; table->TableName = "Profile.db"; table->Active=false; table->FieldDefs->Add("Contacted", ftDateTime, 0, false); table->FieldDefs->Add("Contacted on", ftDate, 0, false); table->FieldDefs->Add("CustNo", ftString, 0, false); table->FieldDefs->Add("Company", ftString, 0, false); table->FieldDefs->Add("Last Name", ftString, 0, false); table->FieldDefs->Add("First Name", ftString, 0, false); table->FieldDefs->Add("Note", ftString, 0, false); table->IndexDefs->Add("", "CustNo", TIndexOptions() <<ixPrimary); table->IndexDefs->Add("CompanyIndex", "Company", TIndexOptions()); table->IndexDefs->Add("LastNameIndex", "Last Name", TIndexOptions()); table->IndexDefs->Add("ContactedIndex", "Contacted", TIndexOptions()); table->IndexDefs->Add("ContactedonIndex", "Contacted on", TIndexOptions()); table->CreateTable(); |