[thelist] RecordCount

Paul Backhouse paul.backhouse at 2cs.com
Thu Mar 21 09:44:00 CST 2002


Hi,
	I'm working on an extranet at the moment - I have several groups which
contain documents - i would liek to count how many documents are contained
in each group.

Its an access database - the code i'm using is below - anyone know how I can
do this?

<%
strQuery = "SELECT [tblGroupData].*, [tblGroups].* FROM [tblGroupData] INNER
JOIN [tblGroups] ON [tblGroupData].[Gid] = [tblGroups].[Gid] WHERE
[tblGroupData].[Uid] = "& Id &""
'response.write strQuery'
Set objRS = objConn.Execute(strQuery)
%>
					<tr>
					<td width=1><img src=images/spacer.gif width=40 height=1 border=0
alt=""></td>
					<td width=430 class="txt" align=left valign=top><br>
					The following documents are available:
					<p>
		<%
		If objRS.Eof AND objRS.Bof Then
		%>
			Sorry, you either have no permissions to view any documents or there are
no documents available to view at present.
		<%
		Else
		%>

		<table width=100% border=0 cellpadding=1 cellspacing=1>
		<tr>
		<td colspan=2 align=left valign=top class="txtW"><b>Groups</b></td>
		<td align=left valign=top class="txtW"><b>Documents</b></td>
		</tr>
		<tr><td><br></td></tr>
		<tr>
		<td align=left valign=top>
			<table border=0 cellpadding=1 cellspacing=1>



			<%
			Do While Not objRS.Eof
			%>
			<tr>
			<td align=left valign=top><a
href="DocumentLibrary.asp?GroupId=<%=objRS("tblGroupData.Gid")%>"
class="txt"><%=objRS("Gname")%></a> ["would like the count to go here"]</td>
			</tr>
			<%
			objRS.movenext
			Loop
			%>
			</table>
		<%
		End If
		%>
		</td></tr></table>

cheers

paul




More information about the thelist mailing list