Record Count

Several ways to get a recordset count...

<%
set MyConn=Server.CreateObject("adodb.connection")
MyConn.Open "DSN=myDSN"
set RS=MyConn.Execute("Select Count(*) from mytable")
myrecordcount=RS(0)
RS.close
set RS=nothing
MyConn.close
Set MyConn=nothing
%>

Or

<%
Set objConn=Server.CreateObject("adodb.recordset")
objConn.Open SQLString, Connection, 1, 3
objConn.RecordCount
%>

Or you can replace RecordCount with BookMark:

<%
Set objConn=Server.CreateObject("adodb.recordset")
objConn.Open SQLString, Connection, 1, 3
objConn.BookMark
%>




count records access sql recordset ASP ADO VBScript tutorial authoring


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site