Show: Delphi C++
Display Preferences

Data.DB.TDataSet.GetRecNo

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetRecNo: Integer; virtual;

C++

virtual int __fastcall GetRecNo();

Properties

Type Visibility Source Unit Parent
function protected
Data.DB.pas
Data.DB.hpp
Data.DB TDataSet

Description

Returns the position of the active record in the dataset. GetRecNo is a getter method for the RecNo property.

Use GetRecNo to get the ordinal position of an active record in the dataset. Datasets like TADOTable,TADODataSet, and TADOQuery inherit GetRecNo and override it according to their needs.

Important: When you implement GetRecNo in the derived classes, ensure that it returns the following values:

  • -1 (if dataset is in dsInsert state)
  • 0 (if dataset is empty)
  • current record number (in other cases)



See Also

Personal tools
In Other Languages
Previous Versions
Assistance