Dim rs as ADODB.Recordset
set rs = ReturnARecordset \'assume ReturnARecordset does just that...
\'do something with rs
rs.Close
set rs = Nothing
Is i
The only reason calling Close
explicitly is when you are not sure if the recordset is referenced from somewhere else in your project, usually a result of some sloppy coding.
Dim rs as ADODB.Recordset
Set rs = ReturnARecordset
...
MyControl.ObscureMethod rs
...
Set rs = Nothing
Last line is supposed to terminate the recordset instance without calling Close
explicitly, unless MyControl
is holding an extra reference and thus preventing normal tear-down. Calling Close
on rs
will make sure MyControl
cannot use its reference for anything useful, crashing in flames in the meantime.