RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBDEDataSet.Post Method

Writes a modified record to the database.

Pascal
procedure Post; override;
C++
virtual __fastcall Post();

Call Post to write a modified record to the database. Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.  

Delphi Examples: 

 

{
This example appends a new record to a table or client
dataset when the user clicks a button. The two fields
Field1 and Field2 are filled from the contents of two edit
controls.  This example requires a populated TTable or
TDataSet with the appropriate field values.
} 
procedure TForm1.Button1Click(Sender: TObject);
begin
  Customers.Append;
  Customers.FieldValues['Field1'] := StrToInt(Edit1.text);
  Customers.FieldValues['Field2'] := Edit2.text;
  Customers.Post;
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!