Sign in Join
FPDoc Onlineexperiment

TCustomBufDataset.InternalPost procedure

Member of TCustomBufDatasetprotectedIn unit BufDataset

Performs actions needed to post a record to the dataset.

Declaration

pascal
procedure InternalPost; override

Description

InternalPost is an overridden procedure which perform actions needed to post a record to the dataset. InternalPost calls the inherited method, which ensures that all required fields have a value. InternalPost checks for buffers allocated for updates to Blob fields in the record. Field number references in the the Blob update buffers are removed.

InternalPost uses the value in the State property to determine if special actions are needed for an inserted record. When State contains dsInsert, the next value for the AutoInc field in the dataset is determined (when present). The ActiveBuffer property contains the values used in field data for the new record. A record buffer is created for the new record by calling the IntAllocRecordBuffer method. A Bookmark for the record is created at the offset in RecordSize in the record buffer. A new record is added to each of the active indexes in BufIndexDefs at the position needed for the Bookmark and the content.in the record buffer.

When State contains a value other than dsInsert, the InternalSetToRecord method is called to store the values in ActiveBuffer to the record in the dataset.

InternalPost ensures that an update buffer is allocated for the record by calling GetActiveRecordUpdateBuffer. If it returns False, a new update buffer is created with the Bookmark to the record. When editing an existing record (State contains the value dsEdit), the UpdateKind in the update buffer is set to ukModify and a record buffer is allocated and set to the pre-editing values for the record. When State contains dsInsert, the UpdateKind value is set to ukInsert and pre-editing record buffer is cleared (set to Nil).

When all modified values have been moved to the dataset record, the active indexes in BufIndexes call their OrderCurrentRecord method to reorder the index using the values for the record.

InternalPost is used in the implementation of the Post method.

See also

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