If you are including this object declaration directly in your asp page (not global.asax) then it terminates itself once the page request ends.
You can also include these in your global.asa file if you want them to persist over the session or application scope.
<OBJECT ID=rsCustomers PROGID="ADODB.Recordset" RUNAT="Server" SCOPE="Application"></OBJECT>
Note the SCOPE
attribute. This loads the recordset into an application variable (can be set to either "session" or "application" depending on your use case). You can easily destroy session variables in your scripts like this:
Session.Abandon
Or if you want to kill the session variable but leave the session open, just terminate the session variable like this:
Set Session("rsCustomers") = Null
If you just want the RS object for the page, then leave out the scope attribute, and include the object declaration in the page itself.
The id will be available as a regular variable as though you declared it in a vbscript codeblock directly in the page. Just remember to do a .close
to close the object, and the object will terminate on its own as soon as the page load is complete (e.g. when the page scope is complete).
Hope this helps.