TBDEDataSet
implements the RecNo
installer only for Paradox
(not DBase
).
unit DBTables; ... procedure TBDEDataSet.SetRecNo(Value: Integer); begin CheckBrowseMode; if (FRecNoStatus = rnParadox) and (Value <> RecNo) then begin DoBeforeScroll; if DbiSetToSeqNo(Handle, Value) = DBIERR_NONE then begin Resync([rmCenter]); DoAfterScroll; end; end; end;
You might want to try something in common:
procedure SetRecNo(DataSet: TDataSet; const RecNo: Integer); var ActiveRecNo, Distance: Integer; begin if (RecNo > 0) then begin ActiveRecNo := DataSet.RecNo; if (RecNo <> ActiveRecNo) then begin DataSet.DisableControls; try Distance := RecNo - ActiveRecNo; DataSet.MoveBy(Distance); finally DataSet.EnableControls; end; end; end; end;
source share