View Full Version : Counting # of items in DB
The Wizzard
01-11-2003, 06:51 PM
Hey guys, how can you count the number of items listed in a database?
Say you have 35 cars in your database...
Make it say "35 cars in the database"
bostjank
01-11-2003, 07:04 PM
'open database
...
sSQL = "SELECT Count(Item) FROM items WHERE Item = 'car'"
set rs = conn.Execute(sSQL)
Response.Write "You have " & rs(0) & " cars in database."
If you want other results you must alter the SELECT statement to count the record that include values you want.
Bostjan
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.