Sign in Join
FPDoc Onlineexperiment

TDataSet.Insert procedure

Member of TDataSetpublicIn unit DB

Insert a new record at the current position.

Declaration

pascal
procedure Insert

Description

Insert will insert a new record at the current position. When this function is called, any pending modifications (when the dataset already is in insert or edit mode) will be posted. After that, the BeforeInsert, BeforeScroll, OnNewRecord, AfterInsert and AfterScroll events are triggered in the order indicated here. The dataset is in the dsInsert state after this method is called, and the contents of the various fields can be set. To write the new record to the underlying database Post must be called.

Errors

If the dataset is read-only, calling Insert will result in an EDatabaseError.

See also

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