Popular Articles | Latest Articles | Categories | RSS Feeds

Login  |  Register

How many records do I have in database table

Published on 2/22/2008 by editor
 Vote this tutorial:

More articles in ASP

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 !

Comments:
no comments submitted


Only members can write comments.Please, login / register to write comment.

Latest Posts

Active News Manager - news management system



ASP.NET Resources, Reviews

ASP Resources, Reviews

PHP, ASP, .NET, JSP Resources, Reviews




Who's online

  • There 29 online users.

ASP.NET Resources, Reviews

ASP Resources, Reviews

PHP, ASP, .NET, JSP Resources, Reviews

Hotscripts.com Free Photoshop, Flash and 3DS MAX tutorials