Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Move to specific row in an ADODB.recordset

18 views
Skip to first unread message

Olaf Jung

unread,
Oct 25, 2009, 5:34:24 PM10/25/09
to
Hello!

I would like to move to a specific row in a recordset.
For example I would like to get the value "MyText" from the 100. row.
A very slow approach would be

dim l&
for l = 1 to rs.recordcount
if l = 100 then
...

Is there a faster way to go to that specific row?

Thank you for help.

Olaf Jung

Norm Cook

unread,
Oct 26, 2009, 8:17:37 AM10/26/09
to
"Olaf Jung" <o.j...@gmx.de> wrote in message
news:%23E0Zwrb...@TK2MSFTNGP05.phx.gbl...

Perhaps
MoveFirst
Move 100


Ralph

unread,
Oct 26, 2009, 6:01:27 AM10/26/09
to

"Olaf Jung" <o.j...@gmx.de> wrote in message
news:%23E0Zwrb...@TK2MSFTNGP05.phx.gbl...

ADODB.Recordset.AbsolutePosition

However, not every provider or cursor will support this method, nor is
it guaranteed to point always point to the same record (only what is the
current 100th).

-ralph


argusy

unread,
Oct 26, 2009, 9:15:54 AM10/26/09
to


in your select statement, start with
SELECT TOP 100 ......
When recordset is opened
Movelast
(Warning - it might not be what you expect,
depending on ORDER BY <parameter> in the query)

Olaf Jung

unread,
Oct 28, 2009, 2:52:00 AM10/28/09
to

Thank you all!
0 new messages