AppendBlank

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

AppendBlank

Declaration

procedure AppendBlank;

Description

Places a new, empty record buffer in Edit mode. After replacing field data, either through visual data controls or through code, calling the Commit method (or Post method) will physically add the new record to the end of the table and update all open indexes. Calling the Cancel method will abort the append process.

 

This method is identical in behavior to the Append method and TDataSet's Insert method.

image\tip.gif Under TApolloTable, this method is simply mapped to Delphi / C++Builder's own TDataSet.Insert method, and is simply included for compatibility purposes.

Delphi Example

// NOTE: Place 3 buttons (ADD, SAVE, & CANCEL) and some bound text controls on a form.

 

// Begin Edit Process with a form full of TDBEdit controls

procedure TForm1.bAddClick(Sender: TObject);

begin

 ApTbl.AppendBlank; { Could also use ApTbl.Insert }

end;

 

// Save new record from data in ghost record

procedure TForm1.bSaveClick(Sender: TObject);

begin

 ApTbl.Commit; { Could also use ApTbl.Post }

end;

 

// If user clicks 'Cancel' button, bail out without saving record data

procedure TForm1.bCancelAddClick(Sender: TObject);

begin

 ApTbl.Cancel; 

end;

C++Builder Example

/* NOTE: Place 3 buttons (ADD, SAVE, & CANCEL) and some bound text controls on a form. */

 

// Begin Edit Process with a form full of TDBEdit controls

void __fastcall TForm1::bAddClick(TObject *Sender)

{

 ApTbl->AppendBlank(); // Could also use ApTbl->Insert()

}

 

// Save new record from data in ghost record

void __fastcall TForm1::bSaveClick(TObject *Sender)

{

 ApTbl->Commit(); // Could also use ApTbl->Post()

}

 

// If user clicks 'Cancel' button, bail out without saving record data

void __fastcall TForm1::bCancelAddClick(TObject *Sender)

{

 ApTbl->Cancel(); 

}

See Also

AppendBlank, Append, Commit, PutRecord, Replace