Jeannie,
You can use NextRecordset() method of RS (recordset) to get next available RS. You've to store RS reference somewhere if you want to process them later. Below you'll find sample code that demondtrates how it can be done.
...
oCon.CursorLocation = 3
oCon.Open
oCommand = CREATEOBJECT("adodb.command")
oCommand.ActiveConnection = oCon
oCommand.CommandType = adCmdStoredProc
oCommand.CommandText = "test_mrs"
oRs = oCommand.Execute()
DIMENSION laRS[1]
lnRScount = 0
DO WHILE NOT ISNULL(oRS)
lnRScount = lnRScount + 1
DIMENSION laRS[lnRScount]
laRS[lnRScount] = oRS
? oRS.RecordCount
oRS = oRS.NextRecordset()
ENDDO
>I'm need to some expertise in the area an unknown number of ADO recordsets returned from a call to an SP.
>
>How can I check for the validity of the last recordset without bombing out? Should I loop through the recordsets to determine the number of recordsets returned first and use the count? If so, how do I best handle this? Each recordset does contain a query name that tells us what the recordset will contain but the number of recordsets can and does vary.
>
>We have a mix of FPW 2.6 and VFP applications that need to do this check.
>
>Advise, please? Thanks in advance~
--sb--