Sign in Join
FPDoc Onlineexperiment

TDataSet.Post procedure

Member of TDataSetpublicIn unit DB

Post pending edits to the database.

Declaration

pascal
procedure Post; virtual

Description

Post attempts to save pending edits when the dataset is in one of the edit modes: that is, after a Insert, Append or Edit operation. The changes will be committed to memory - and usually immediately to the underlying database as well. Prior to saving the data to memory, it will check some constraints: in TDataset, the presence of a value for all required fields is checked. if for a required field no value is present, an exception will be raised. A call to Post results in the triggering of the BeforePost, AfterPost events. After the call to Past, the State of the dataset is again dsBrowse, i.e. the dataset is again in browse mode.

Errors

Invoking the post method when the dataset is not in one of the editing modes ( dsEditModes) will result in an EdatabaseError exception. If an exception occurs during the save operation, the OnPostError event is triggered to handle the error.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.