Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Records in Multiple Tables 1

Status
Not open for further replies.

ElEye

IS-IT--Management
Nov 17, 2001
187
US
I would like to present the total number of records of 2 MS Access tables on one page. That is to say that I'd like to display 2 response.writes: 1 record count of all records for each table.

How would I go about this?

Thank you in advance! Dave [idea]
[]
 
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open "some conn string"
objRS.ActiveConnection = objConn
objRS.Open "SELECT Count(*) FROM table1"
Response.Write "Table1 has "& objRS.Fields(0).Value &" record(s)"
objRS.Close
objRS.Open "SELECT Count(*) FROM table2"
Response.Write "Table2 has "& objRS.Fields(0).Value &" record(s)"
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top