Board index » delphi » Getting record number in Paradox

Getting record number in Paradox

Does anyone know of a way to get the current record number when working
with a Paradox Database?  I found the record number property that tells me
how many records are in the database, but I have not been able to find a
way to determine the current record number.

Thanks in advance,
Ken

 

Re:Getting record number in Paradox


Quote
In article <48vpkj$...@newsbf02.news.aol.com>, <kpree...@aol.com> writes:
> Xref: Utrecht.NL.net comp.lang.pascal.delphi.databases:5873
> Path:

Utrecht.NL.net!sun4nl!EU.net!newsfeed.internetmci.com!in2.uu.net!newstf01.news.a
ol.com!newsbf02.news.aol.com!not-for-mail
Quote
> From: kpree...@aol.com (KPReeder)
> Newsgroups: comp.lang.pascal.delphi.databases
> Subject: Getting record number in Paradox
> Date: 22 Nov 1995 13:20:03 -0500
> Organization: America Online, Inc. (1-800-827-6364)
> Lines: 7
> Sender: r...@newsbf02.news.aol.com
> Message-ID: <48vpkj$...@newsbf02.news.aol.com>
> Reply-To: kpree...@aol.com (KPReeder)
> NNTP-Posting-Host: newsbf02.mail.aol.com

> Does anyone know of a way to get the current record number when working
> with a Paradox Database?  I found the record number property that tells me
> how many records are in the database, but I have not been able to find a
> way to determine the current record number.

Borland TI Doc - NUMBER  :  2849

The pRECProps structure consists of the fields:

  iSeqNum: type LongInt; specifies the sequence number of the record
    (relative to the data set, including filtering and index ordering);
    applicable if the table type supports sequence numbers (Paradox only).

  iPhyRecNum: type LongInt; specifies the record number for the record;
    applicable only when the table type supports physical record numbers
    (dBASE only).

  bRecChanged: type Boolean; not currently used.

  bSeqNumChanged: type Boolean; not currently used.

  bDeleteFlag: type Boolean; indicates whether the record is deleted;
    applicable only for table types that support soft-deletes (dBASE
    only).

One of these BDE functions may be invoked in a Delphi application to fill
this structure, from which the physical record number may be retrieved.
Below is an example of the DbiGetRecord function used for this purpose.

  function RecNo(ATable: TTable): LongInt;
  var
    R: RECProps;
    rslt: DbiResult;
    Error: array [0..255] of Char;
  begin
    ATable.UpdateCursorPos;
    rslt := DbiGetRecord(ATable.Handle, dbiNoLock, nil, @R);
    if rslt = DBIERR_NONE then
      Result := R.iPhyRecNum
    else begin
      DbiGetErrorString(rslt, Error);
      ShowMessage(StrPas(Error));
      Result := -1;
    end;
  end;

--
As far as I can see, then it's not possible t get the physical (only the logical
) record number in a Paradox table.

More TI Doc's
ftp.borland.com
PUB/techinfo/techdocs/language/delphi/ti

Regards,
  Martin Djernaes

Re:Getting record number in Paradox


In <48vpkj$...@newsbf02.news.aol.com> kpree...@aol.com (KPReeder)
writes:

Quote

>Does anyone know of a way to get the current record number when
working
>with a Paradox Database?  I found the record number property that
tells me
>how many records are in the database, but I have not been able to find
a
>way to determine the current record number.

>Thanks in advance,
>Ken

You can do this either in the on click event of a button or or on the
datachange event for DataSource (which will be automatic).

procedure ........ (see above)
var
 RecNo: LongInt;
begin
 Table1.UpdateCursorPos;
 DbiGetSeqNo(Table1.Handle, RecNo);
 Panel1.Caption :='Record Number: ' + IntToStr(RecNo);
end;

Ben
Arrow Software

Other Threads