Skip to main content

Close

procedure Close;

Example

procedure CloseData(const Data: TvxClientDataSet);
begin
Data.Close;
end;

Usage

Close deactivates the dataset, cancelling any pending edit and releasing its cursor and buffers.

  • Post explicitly before closing only when the pending change should be retained.
  • All current field values, cursor position and raw buffers become unusable after close.
  • Close is not a database commit or connection-wide transaction action.

Additional Technical Info

Close is declared by hidden ancestor TDataSet and is normally used through a visible descendant such as TvxClientDataSet. It is equivalent to assigning Active := False.

Source-backed behaviour

If already inactive, the property setter does nothing. Otherwise it runs before-close (except during destruction), calls Cancel for edit/insert state, sets state inactive, closes the cursor, frees field buffers and record buffers, invokes descendant InternalClose, then runs after-close.

TvxClientDataSet.SetActive(False) additionally detaches its provider and closes the owned SQL dataset in edit mode (and its normal non-edit workflow already detaches after opening). Unposted record changes are cancelled, not posted.

Open activates again. Active exposes the same lifecycle control.

Official RTL references

Created 2026-07-15