Position in ADO Recordset

Position in ADO Recordset

Postby Jimmy » 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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Position in ADO Recordset

Postby Cgallegoa » Sun Jun 11, 2023 1: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-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: Position in ADO Recordset

Postby nageswaragunupudi » Sun Jun 11, 2023 1: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: Select all  Expand view
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: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Position in ADO Recordset

Postby Jimmy » Sun Jun 11, 2023 3: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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests