Click to See Complete Forum and Search --> : ADODB.recordset and querying twice


pelegk1
10-24-2005, 03:43 AM
i have 2 queries which i want to make with the same object
so i did :
set rs=Server.CreateObject("ADODB.recordset")
rs.open "select count(uid) from table1"
response.write rs.RecordCount
rs.Close
rs.open "select count(uid) from table2"
response.write rs.RecordCount
but i get -1 on the second rs.Open
why is that?
thnaks in advance
peleg

Bullschmidt
10-25-2005, 07:12 PM
Instead of this:
rs.Close

Perhaps use this:
rs.Close
Set rs = Nothing