How many records do I have in database table
Sometimes we worry about limits of database table and we need to know how manay recods we have. In ASP we could count all recods using a loop. But if we have a small piece of knowledge about SQL script, our script works better and faster.
In the start of our script, no need to write so much codes. All work will be done in an SQL script. Here is all code.
<%
set con = server.createobject("adodb.connection")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/db/mydb.mdb")
set rec = con.execute("select count(*) from mytable")
response.write rec(0)
%>
Yellow marked part of code is important which part displays count of records in our database.
Have a nice coding and keep visiting us back !
Custom Search
- How to Refresh a web page or redirect to another page
- Custom Paging in ASP Fast And Easy
- Professional Contact Form
- Creating Access Database Connection String
- Using DateDiff function in SQL Statement
- VBScript Examples DatePart Function
- Executing Transact SQL UPDATE statement using SQLCommand
- Custom Paging results in ASPNET using A Better Way
- Using GetDate Function in an SQL Statement
- Copying Folders using File System Object
- Form to Mail Using CDO
- Sending Emails in JSP
- MySQL AB Offers its Enterprise Database Subscriptions through the New Red Hat Exchange
- Display Top N records from MS Access
- How to display date time in real time
- Easy Download Manager Free Version
- ASP Chat Box
- Writing Form Data to Text Files
- Paging Records in JSP
- What is Ecommerce and the Importance of Ecommerce
- Beginning-Ajax-and-ASPNET-35
- How to upload images to mySQL within PHP
- Simple XML RSS Parser
- Counting records in PHP mySQL
- ActiveNews Manager Freeware News Exchange Software
- How to write and use a JavaBean My frst java bean
- Paging Results in PHP
- Free User Registration Form
- A-timesaver-control-GridView
- ASPNET Web Counter Free Open Source Code
- Easy Download Manager Free Version
- ASP Chat Box
- Writing Form Data to Text Files
- Paging Records in JSP
- Beginning-Ajax-and-ASPNET-35
- How to upload images to mySQL within PHP
- Simple XML RSS Parser
- ActiveNews Manager Freeware News Exchange Software
- Counting records in PHP mySQL
- How to write and use a JavaBean My frst java bean
- Paging Results in PHP
- Free User Registration Form
- A-timesaver-control-GridView
- ASPNET Web Counter Free Open Source Code
- Comparing Dates