[thelist] Multiple RecordSets

Simon Davies simon.davies at bigpond.com
Thu Jun 1 12:01:51 2000


Hi,
Does anyone use Multiple Recordsets with ADO, if so how do you check when a
record set is no longer an object and has been set to nothing. For example,
I do the following when retrieving results from a stored proc, that
potentially returns multiple record sets, the first of which may be empty:

if adoRecordSet.bof and adoRecordSet.eof and adoRecordSet.state <>
adStateClosed then
 do
  set adoRecordSet = adoRecordSet.nextrecordset
 loop until (not adoRecordSet.bof and not adoRecordSet.eof) or
(adoRecordSet.state = adStateClosed)
end if

If I get a result set back thats empty, then I move to the next one, but
there might not be one and the recordset becomes nothing. How do I then
check this, as soon as I reference the adoRecordSet object I get an error
returned. I can use on error resume next and check the err object, but this
seems a little tacky.

Any clues would be appreciated,

Simon