I believe the difference is negligible when it comes to processing time. But what I think matters is how difficult it could be to debug your ASP code whenever you try to use a single recordset object on different tables in your database.
Ok...another question - btw thanks to all for your help
Now, if I want to use the same recordset object - re open it with a different query each time...do I need to set it to nothing before re-opening it?? I know I need to at least close it first...but something still isn't working. Every time I try to run the code the page gets "stuck", it won't finish loading.
Here's the relevant portion of my code:
<%
Dim rs
Set rs = Server.CreateObject("ADODB.RecordSet"
Dim strItem
sSqlString = "SELECT * FROM itemlist WHERE category = 'apparel'"
rs.Open sSqlString, oConnection, 0
Do While NOT rs.EOF
strItem = rs("item"
%>
<option><%=strItem%></option>
<%
rs.MoveNext
Loop
rs.Close
%>
...some more html, then:
<%
sSqlString = "SELECT * FROM itemlist WHERE category = 'miscellaneous'"
rs.Open sSqlString, oConnection, 0
Do While NOT rs.EOF
strItem = rs("item"
%>
<option><%=strItem%></option>
<%
Loop
rs.MoveNext
rs.Close
%>
And yes, setting it to Nothing would be good. I have seen some extremely strange results occur occasionally when not setting it to nothing. Like no results at all
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.