DelphiFAQ Home Search:
General :: Programming :: Delphi :: Database
Database development with Delphi. Includes issues with BDE, ADO and InterBase.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Determining the record number in a dBASE / Paradox table

The following procedure determines the physical number of the current record
in a dBase or Paradox table:

function FindRecordNumber (aDataSet : TDataSet): longint;
  cP: CurProps;
  rP: RECProps;
  DBRes: DBiResult;
  {Return 0 if dataset is not Paradox or dBase}
  Result := 0;
  with aDataset do
    if state = dsInactive then exit;
    {we need to make this call to grab the cursor's iSeqNums}
    DBRes := DBiGetCursorProps(Handle,cP);
    if DBRes <> DBIERR_NONE then exit;
    {synchronize the BDE cursor with the dataset's cursor}
    {fill rP with the current record's properties}
    DBRes := DBiGetRecord(Handle,DBiNOLOCK,nil,@rP);
    if DBRes <> DBIERR_NONE then exit;
    {what kind of dataset are we looking at?}
    case cP.iSeqNums of
     0: result := rP.iPhyRecNum; {dBase}
     1: result := rP.iSeqNum;    {Paradox}

Generated 8:01:27 on Jun 26, 2019