<%
objRs.recordcount
%>
Where objRs = your recordset object
Main Topics
Browse All TopicsI have an ASP page which displays all the members who have registered for a national reunion. they are sorted in the order that people registered, but I want to display the total number of registrants in the top right of the first page.
I have tried to follow the record count etc but I am still a little non-plussed.
Grateful for any help
tks
Ursa
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
@UrsaMajor
No it does not matter which database its coming from. So access is ok.
Secondly to identify your recordset object try and see where you are doing the below line...
set objRecordset=Server.Create
here objRecordset would be your recordset object....it could be set as anything based on your thinking....
If you could paste the code then i shall help you....
Here is the ASP code which displayes the records from the Access database:
<meta http-equiv="Content-Langua
<html>
<head>
<TITLE>2008 National Reunion - Attendees</TITLE>
<style>
body,td,th,p {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
</style>
</HEAD>
<BODY text="#FFFFFF" bgcolor="#002142">
<H1><font face="Arial Rounded MT Bold">2008 National Reunion - Attendees</font></H1>
<HR>
<%
Set conn = Server.CreateObject("ADODB
conn.Open "Provider=Microsoft.Jet.OL
''Set rsNewID = commInsert.Execute("SELECT
''intNewID = rsNewID(0) ' Store the value of the new identity in variable intNewID
Set rs = SERVER.CreateObject("ADODB
Set ts = SERVER.CreateObject("ADODB
' first have to get the category records to fill the drop down....
' Set SQL statement
strSQL = "SELECT Members.[Given Name] as name, Members.Surname as sname, Members.[Nick Name] as nick,Members.Nee as Ne,Members.[Partner Given Name] as given,Members.[State or Country] as loc, Members.mru FROM Members WHERE (((Members.mru)=false));"
' Open Recordset Object
rs.Open strSQL,conn, adOpenStatic
%>
<h2> </h2>
<table width="100%" cellpadding="2" cellspacing="2">
<tr>
<td width="15%"><b>First Name</b></td><td width="20%"><b>Last Name</b></td><td width="20%"><b>Partner Name</b></td></td><td width="15%"><b>Nee</b></td
</tr>
<%
Do While Not rs.EOF
Response.write("<tr>")
Response.write("<td>" & rs("name") & "</td><td>" & rs("sname") & "</td><td>" & rs("given") & "</td><td>" & rs("Ne") & "</td><td>" & rs("loc") & "</td>")
Response.write("</tr>")
rs.MoveNext
Loop
%>
</table>
<%
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</body>
</html>
@UrsaMajor
Use the below code, i have revamped it to show the total recordcount....
<meta http-equiv="Content-Langua
<html>
<head>
<TITLE>2008 National Reunion - Attendees</TITLE>
<style>
body,td,th,p {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
</style>
</HEAD>
<BODY text="#FFFFFF" bgcolor="#002142">
<H1><font face="Arial Rounded MT Bold">2008 National Reunion - Attendees</font></H1>
<HR>
<%
Set conn = Server.CreateObject("ADODB
conn.Open "Provider=Microsoft.Jet.OL
''Set rsNewID = commInsert.Execute("SELECT
''intNewID = rsNewID(0) ' Store the value of the new identity in variable intNewID
Set rs = SERVER.CreateObject("ADODB
Set ts = SERVER.CreateObject("ADODB
' first have to get the category records to fill the drop down....
' Set SQL statement
strSQL = "SELECT Members.[Given Name] as name, Members.Surname as sname, Members.[Nick Name] as nick,Members.Nee as Ne,Members.[Partner Given Name] as given,Members.[State or Country] as loc, Members.mru FROM Members WHERE (((Members.mru)=false));"
' Open Recordset Object
rs.Open strSQL,conn, adOpenStatic
%>
<h2><%response.write "Total Number Of Records : " & rs.recordcount %></h2>
<table width="100%" cellpadding="2" cellspacing="2">
<tr>
<td width="15%"><b>First Name</b></td><td width="20%"><b>Last Name</b></td><td width="20%"><b>Partner Name</b></td></td><td width="15%"><b>Nee</b></td
</tr>
<%
Do While Not rs.EOF
Response.write("<tr>")
Response.write("<td>" & rs("name") & "</td><td>" & rs("sname") & "</td><td>" & rs("given") & "</td><td>" & rs("Ne") & "</td><td>" & rs("loc") & "</td>")
Response.write("</tr>")
rs.MoveNext
Loop
%>
</table>
<%
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</body>
</html>
@UrsaMajor
Recordcount is not supported with the default forward-only cursor. If you open a recordset in the following manner, you will have access to recordcount.... i have revamped the code so use it....you can place the recordcount whereever you want, for timebeing i had added it in the HEADER...
<meta http-equiv="Content-Langua
<html>
<head>
<TITLE>2008 National Reunion - Attendees</TITLE>
<style>
body,td,th,p {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
</style>
</HEAD>
<BODY text="#FFFFFF" bgcolor="#002142">
<H1><font face="Arial Rounded MT Bold">2008 National Reunion - Attendees</font></H1>
<HR>
<%
Set conn = Server.CreateObject("ADODB
conn.Open "Provider=Microsoft.Jet.OL
''Set rsNewID = commInsert.Execute("SELECT
''intNewID = rsNewID(0) ' Store the value of the new identity in variable intNewID
Set rs = SERVER.CreateObject("ADODB
Set ts = SERVER.CreateObject("ADODB
' first have to get the category records to fill the drop down....
' Set SQL statement
strSQL = "SELECT Members.[Given Name] as name, Members.Surname as sname, Members.[Nick Name] as nick,Members.Nee as Ne,Members.[Partner Given Name] as given,Members.[State or Country] as loc, Members.mru FROM Members WHERE (((Members.mru)=false));"
' Open Recordset Object
rs.Open strSQL,conn,1,1
%>
<h2><%response.write "Total Number Of Records : " & rs.recordcount %></h2>
<table width="100%" cellpadding="2" cellspacing="2">
<tr>
<td width="15%"><b>First Name</b></td><td width="20%"><b>Last Name</b></td><td width="20%"><b>Partner Name</b></td></td><td width="15%"><b>Nee</b></td
</tr>
<%
Do While Not rs.EOF
Response.write("<tr>")
Response.write("<td>" & rs("name") & "</td><td>" & rs("sname") & "</td><td>" & rs("given") & "</td><td>" & rs("Ne") & "</td><td>" & rs("loc") & "</td>")
Response.write("</tr>")
rs.MoveNext
Loop
%>
</table>
<%
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</body>
</html>
Cheers
^_^
BUGS
Well Done. Code works excellently. I have two further ingratiating quetions. Can I change the font size to something smaller, and second, can I also change the 'Total Number of Records" to 'total number of Attendees'. The second is in the red code which I understand cannot or should not be edited.
warmest tks
Ursa
>> Can I change the font size to something smaller and second, can I also change the 'Total Number of Records" to 'total number of Attendees' ?
Yes you can, just manipulate the line below...
<h2><%response.write "Total Number Of Attendees : " & rs.recordcount %></h2>
TRY changing it to....
<h3><%response.write "Total Number Of Attendees : " & rs.recordcount %></h3>
<h4><%response.write "Total Number Of Attendees : " & rs.recordcount %></h4>
Or
<font color="red" face="verdana"><%response.
Business Accounts
Answer for Membership
by: bugsPosted on 2007-08-15 at 00:07:29ID: 19697607
do this
objRs.recordcount which would give you total records fetched by the query