[thelist] ADO cursor - best solution for count and page through procedure

Adriano Castro ad at netvisao.pt
Wed Mar 31 05:58:29 CST 2004


    After reading (1) http://adopenstatic.com/faq/jetcursortypes.asp I
asked myself which is the most appropriate cursor to use taking into
consideration that before paging through a recordset I first want to
count the number of entries on it.

    I don't want to create two recordsets (one for COUNT(*) and another
one with the actual data) so I'm only using one.

    With a adOpenForwardOnly cursor I can't use the .recordCount property
so I'm using GetRows() and saving it in an array. However, after
having done that I need to page the recordset to its first entry
through MoveFirst(). According to (1) by doing so the recordset is
closed and the query re-executed. That can't be good...

    Should I, for this purpose, use a adOpenStatic and use the
.recordCount property? Or is the current method being used faster?

    Also, if all I want to do is check if the recordset returns anything
is "IF (recordset.EOF) THEN do_something END IF" the best thing to do?

    AD

--
www.adrianocastro.net


More information about the thelist mailing list