Subject | Don't have any error but it is not Posting !!! |
---|---|
Author | alvin@digi.com.ph |
Post date | 2001-03-20T01:18:36Z |
This code does not create any error, but i wonder why the records are
not being posted, Table is created at run-time and it's OK ???...
void __fastcall TFormNMain::FormCreate(TObject *Sender)
{
IBOTable->Active = false;
IBOTable->DatabaseName = DgConnection->Path;
IBOTable->TableName = "Check";
IBOTable->FieldDefs->Add( "Name", ftString, 512, true );
IBOTable->FieldDefs->Add( "Address", ftString, 512, true );
IBOTable->FieldDefs->Add( "Attribute", ftInteger, 0, true );
IBOTable->CreateTable();
IBOTable->Active = true;
IB_Query->Active = true; // Select Name, Status FROM Check
// Fields to show in IB_Grid
try {
IBOTable->Append();
IBOTable->FieldByName( "Name" )->AsString = "Name";
IBOTable->FieldByName( "Status" )->AsString = "Status";
IBOTable->FieldByName( "Attribute" )->Value = 0;
IBOTable->Post();
IB_Grid->Update();
IBOTable->Refresh();
}
catch ( ... ) {
ShowMessage("Record not Posted !!!");
}
}
not being posted, Table is created at run-time and it's OK ???...
void __fastcall TFormNMain::FormCreate(TObject *Sender)
{
IBOTable->Active = false;
IBOTable->DatabaseName = DgConnection->Path;
IBOTable->TableName = "Check";
IBOTable->FieldDefs->Add( "Name", ftString, 512, true );
IBOTable->FieldDefs->Add( "Address", ftString, 512, true );
IBOTable->FieldDefs->Add( "Attribute", ftInteger, 0, true );
IBOTable->CreateTable();
IBOTable->Active = true;
IB_Query->Active = true; // Select Name, Status FROM Check
// Fields to show in IB_Grid
try {
IBOTable->Append();
IBOTable->FieldByName( "Name" )->AsString = "Name";
IBOTable->FieldByName( "Status" )->AsString = "Status";
IBOTable->FieldByName( "Attribute" )->Value = 0;
IBOTable->Post();
IB_Grid->Update();
IBOTable->Refresh();
}
catch ( ... ) {
ShowMessage("Record not Posted !!!");
}
}