[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# TDataSet.Next

Go to the next record in the dataset.

## Declaration

Source position: db.pas line 1587

`public procedure TDataSet.Next;`

## Description

Next positions the cursor on the next record in the dataset. It is equivalent to a MoveBy(1) operation. Calling this method triggers the TDataset.BeforeScroll and TDataset.AfterScroll events. If the dataset is located on the last known record (EOF is true), then no action is performed, and the events are not triggered.

## Errors

Calling this method on a closed dataset will result in an EDatabaseError exception.

## See also

TDataset.MoveBy |  | Move the cursor position
TDataset.Prior |  | Go to the previous record
TDataset.Last |  | Navigate forward to the last record
TDataset.BeforeScroll |  | Event triggered before the cursor changes position.
TDataset.AfterScroll |  | Event triggered after the cursor has changed position.
TDataset.EOF |  | Indicates whether the last record has been reached.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .