When you just do
you get a FORWARD ONLY cursor, and you can't get the record count from such a cursor. You need to use a STATIC cursor, via adOpenStatic. Or, in practical terms:
Code:
rs.Open sql, db, 3 ' yes, 3 is adOpenStatic
response.write rs.RecordCount