Rs.RecordCount

To count the number of records in a table. At the same time you can use the same recordset for other work also.

Set Rs=Server.CreateObject("ADODB.Recordset")
Rs.CursorLocation=3 ' this line is must for Record Count
sql=".........."
Rs.Open sql,Con
cnt=Rs.RecordCount