PDA

Click to See Complete Forum and Search --> : Can i get an Opinion here?


scottr
Jul 10th, 2000, 01:49 PM
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?

dvst8
Jul 10th, 2000, 01:56 PM
looks alright to me scott

u getting errors?

dvst8

scottr
Jul 10th, 2000, 01:59 PM
Im not getting any errors, I just want to make sure that I am writing clean code...

dvst8
Jul 10th, 2000, 02:01 PM
cleaner than mine ;)

Mark Sreeves
Jul 10th, 2000, 02:10 PM
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.

dvst8
Jul 11th, 2000, 09:10 AM
mark = cleanest of clean :)

the way mark suggested is definitely the best way to go.