I started off trying to get number of records of ADO rs when executing my stored procedure using rs.RecordCount but it always returned -1 although the rs had thousands of records. Doing a search, I read that using static cursor type should fix the problem and I also read that changing cursor to client side should fix that but also came across lot of advice that it is better to use GetRows to put all records from recordset into an array then close connections to backend server and get records from the array. You can also use UBound(rsGetRows, 2) + 1 (where rsGetRows=rs.GetRows) to get the count of records returned from the stored procedure.
Going to
Recordset Object Basics gave lots of detailed documentation on how to set type of cursor.
I used the following code for testing:
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
Set rs = Cmd1.Execute()
MsgBox rs.RecordCount
rsGetRows = rs.GetRows
MsgBox UBound(rsGetRows, 2) + 1
MsgBox rsGetRows(1, 1)
rs.RecordCount still returns -1, but GetRows works and UBound does result in number of records returned.
Thanks again for the help.