Unit 'DB' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#fcl]

TDataSet.Post

Post pending edits to the database.

Declaration

Source position: db.pas line 1934

public procedure TDataSet.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 TDataset.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

Insert

  

Insert a new record at the current position.

Append

  

Append a new record to the data.

Edit

  

Set the dataset in editing mode.

OnPostError

  

Event triggered when a post operation fails.

BeforePost

  

Event called before changes are posted to the underlying database.

AfterPost

  

Event called after changes have been posted to the underlying database.

State

  

Current operational state of the dataset.


Documentation generated on: Oct 27 2024