On Mon, 15 Mar 2004 15:51:05 -0600, "Manohar Kamath [MVP]"
<mk*****@TAKETHISOUTkamath.com> wrote:
' Initialize previous ID to empty
prevPubID = vbNullstring
' Loop through the entire recordset
Do While Not Rs.EOF
' Set the current pub ID
curPubID = Rs("PubID")
' If the current ID not equal to previous one, create a new paragraph
If curPubID <> prevPubID Then
Response.Write("<P>" & curPubID)
End If
' Write out the attributes
Response.Write(Rs("Title"))
Rs.MoveNext
' Set previous ID to current one
prevPubID = curPubID
Loop
Manohar, thanks for your reply. Exactly, where in the page should put
in your code? Should I get rid of the repeat regions? I could use any
amount of help since I'm pretty confused about this right now. I'm
trying to understand your code using a couple of books I have here.
Thanks again. crispy.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../../Connections/IHEA_DNSLESS.asp" -->
<%
Dim rdsAllTitles
Dim rdsAllTitles_numRows
Set rdsAllTitles = Server.CreateObject("ADODB.Recordset")
rdsAllTitles.ActiveConnection = MM_IHEA_DNSLESS_STRING
rdsAllTitles.Source = "SELECT * FROM qryAllTitles"
rdsAllTitles.CursorType = 0
rdsAllTitles.CursorLocation = 2
rdsAllTitles.LockType = 1
rdsAllTitles.Open()
rdsAllTitles_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rdsAllTitles_numRows = rdsAllTitles_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<table width="100%" border="1" cellpadding="5">
<tr bgcolor="#CCCCCC">
<td><strong>PubID</strong></td>
<td><strong>Region</strong></td>
<td><strong>Language</strong></td>
<td><strong>Title</strong></td>
<td><strong>Subject</strong></td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rdsAllTitles.EOF))
%>
<tr>
<td><%=(rdsAllTitles.Fields.Item("PubID").Value)%> </td>
<td><%=(rdsAllTitles.Fields.Item("Region").Value)% ></td>
<td><%=(rdsAllTitles.Fields.Item("LanguageName").V alue)%></td>
<td><%=(rdsAllTitles.Fields.Item("TitleName").Valu e)%></td>
<td><%=(rdsAllTitles.Fields.Item("DiseaseName").Va lue)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rdsAllTitles.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
rdsAllTitles.Close()
Set rdsAllTitles = Nothing
%>