-
Hi i am opening up serveral recordsets on my page and I use these to populate drop down boxes. Now I want to close all the recordsets: I put them in the following location near the end of the page. I also close them out using this function:
function closeRS(rs)
RS.Close
Set RS = Nothing
end function
</table>
</body>
<%
'close it out
closeRS(rst1)
closeRS(rst2)
closeRS(rst3)
closeRS(rst4)
closeRS(rst5)
closeRS(dbConn)%>
</html>
Does anyone see anything wrong with this method?
-
looks alright to me scott
u getting errors?
dvst8
-
Im not getting any errors, I just want to make sure that I am writing clean code...
-
-
Well, it looks OK but question why do you need so many recordsets open at once?
If I'm doing several queries I close the record set and reuse the variable.
I then set the recordset and connection to nothing at the end of the page.
-
mark = cleanest of clean :)
the way mark suggested is definitely the best way to go.