Re: RecordSet.Close Throwing Errors
- From: "Stephen Howe" <sjhoweATdialDOTpipexDOTcom>
- Date: Fri, 3 Feb 2006 12:11:20 -0000
I call a stored procedure that returns either 1, 2 or 3 recordsets.
You did do
Dim rs as ADODB.Recordset
Set rs = New ADODB.Recordset
and not
Dim rs as New Recordset
I loop through the recordsets using
Do Until rs Is Nothing
Looping through what?
I assume you mean
rs.= rs.NextRecordSet
when you have finished with the current recordset.
As I don't know how to determine how many recordsets there are. Is there a
method for doing this?
I don't think there is (but if there was, it would be a dynamic property)
Lastly after I'm done I call rs.close
However if I've ran out of recordsets in the above loop this throws an
error
also.
Is it sufficient to just set rs = nothing instead of rs.close?
No.
I am not at work right now, so I can't consult resources. This is being
recalled from memory (so it may be wrong in places, mostly pseudocode)
But I think you should have something like
'populate rs
Do Until rs Is Nothing
Do
' Loop over Recordset using MoveNext(), whatever
Loop
If (rs.state AND ADOOpenConstant) <> 0 THEN
rs.Close
END IF
rs = rs.NextRecordSet
Loop
Stephen Howe
.
- Prev by Date: Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- Next by Date: Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- Previous by thread: Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- Next by thread: CADORecordBinding
- Index(es):
Relevant Pages
|
|