Thelma Lubkin wrote:
GetRows Method
Retrieves multiple records of a Recordset object into an array.
Syntax
array = recordset.GetRows( Rows, Start, Fields )
Return Value
Returns a Variant whose value is a two-dimensional array.
Parameters
Rows
Optional. A GetRowsOptionEnum value that indicates the number of
records to retrieve. The default is adGetRowsRest.
Did you notice that there is a DAO GetRows and an ADO GetRows. You are
quoting (and using, I think) ADO, but I think Hank is using DAO.
I think the NumRows Parameter in DAO GetRows(NumRows) is not documented
well. The Help file does not indicate that NumRows is optional, but the
Object Browser does, but not the default value. Expperience shows the
default value in DAO is one, while, as you have pointed out, in ADO its
the rest.
I don't know about whether it's worthwhile to use GetRows in VBA. As
David points out, the Recordset can be used in somewhat the same way a
VBA array can. My experience is that VBA Array manipulation is faster
than Recordset manipulation, so, if one plans to do a lot of
manipulation, setting the Array may be worth it. It's also nice to know
that one's data is secure. As one is not working with your Recordset,
one can be sure one is not doing anything bad to the data, which may
trickle down to be stored in some unforeseen way.
Regardless when it comes to languages where array manipulation is many
times more advanced than VBA, the array can be very worthwhile and
millions of times faster than Recordset manipulation. Here we have
methods such as concat, join, pop, push, reverse, shift, slice, sort,
splice and unshift that make Arrays incredibly powerful. One such not
quite a language is javascript.