Dim rs as ADODB.Recordset
set rs = ReturnARecordset \'assume ReturnARecordset does just that...
\'do something with rs
rs.Close
set rs = Nothing
Is i
You can run into ODBC or OLEDB Pooling issues, which keep a connection open and tie up a pool slot:
Common causes of connection creep include:
The ADO Connection and Recordset objects are not actually closed. If you don't explicitly close them, they won't be released into the pool. This is probably the single most frequent cause of connection creep.
An ADO object you created (especially a Connection object) was not explicitly released. Explicitly releasing objects you create is just good programming practice. If you allocate memory, release it. Depending on the language you are using, letting a variable go out of scope may or may not result in it being released.
See Pooling in the Microsoft Data Access Components
And if there is any chance of .Net Interop involved be wary: there are lots of warnings about problems caused due to the lazy way COM object (or contained object) release occurs under .Net's garbage collection.