FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Position in ADO Recordset
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Position in ADO Recordset
Posted: Sat Jun 10, 2023 11:50 PM
hi,

i can use ADO Method MoveFirst, MoveLast, MoveNext and MovePrevious to move to a Position but how to get the actual "Position" in ADO Recordset :?:
RECNO() does not work with EXCEL ...

how to find out how many ROW Recordset have :?:
greeting,

Jimmy
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: Position in ADO Recordset
Posted: Sun Jun 11, 2023 01:13 AM
Jimmy,

Equivalents:
  • Found() --> .not. oRs:Eof()
    RecNo() --> oRs:BookMark
    DbGoTo( n ) --> oRs:BookMark := n
    OrdKeyNo() --> oRs:AbsolutePosition
    OrdKeyGoTo( x ) --> oRs:AbsolutePosition := x
Regards,

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Position in ADO Recordset
Posted: Sun Jun 11, 2023 01:13 AM
oRs:BookMark --> is like RECNO() of DBF
oRs:AbsolutePosition --> is like OrdKeyNo() of DBF

After reading a recordset, both point to the same record.

After reading a recordset, we can sort the recordset in memory by
Code (fw): Select all Collapse
oRs:Sort := cFieldName
After sorting, oRs:BookMark points to the record number in the original order as read where as oRs:AbsolutePosition points to the relative position in the sorted order.

Usage:
Code (fw): Select all Collapse
uBm := oRs:BookMark
oRs:BookMark := 50.0
n := oRs:AbsolutePostion
oRs:AbolutePostion := 20
https://www.w3schools.com/asp/ado_intro.asp
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Position in ADO Recordset
Posted: Sun Jun 11, 2023 03:42 AM
hi,
nageswaragunupudi wrote:After sorting, oRs:BookMark points to the record number in the original order as read where as oRs:AbsolutePosition points to the relative position in the sorted order.
ah, understand

thx for all Answer
greeting,

Jimmy

Continue the discussion