EPUB | CHM | PDF

TDataSet.Methods.CheckBrowseMode

Top Previous Next

Automatically posts or cancels data changes when an application changes which record in the dataset is the active record.

Syntax:

procedure CheckBrowseMode;

Description:

CheckBrowseMode is used internally by many dataset methods to ensure that modifications to the active record are posted to the database when a dataset's state is dsEdit, dsInsert, or dsSetKey state and a method switches to a different record.

If State is dsEdit or dsInsert, CheckBrowseMode calls UpdateRecord, and then, if the Modified property for the dataset is True, calls Post. If Modified is False, CheckBrowseMode calls Cancel.

If State is dsSetKey, CheckBrowseMode calls Post.

If State is dsInactive, CheckBrowseMode raises an exception.

If an application uses existing dataset methods, CheckBrowseMode is always called when necessary, so there is usually no need to call CheckBrowseMode directly.

Applications that provide custom dataset routines may need to call CheckBrowseMode inside those routines to guarantee that changes are posted to the database when switching to a different record.