On Mon, 15 Mar 2004 15:51:05 -0600, "Manohar Kamath [MVP]"
<mk*****@TAKETH ISOUTkamath.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="VB SCRIPT" CODEPAGE="1252" %>
<!--#include file="../../Connections/IHEA_DNSLESS.as p" -->
<%
Dim rdsAllTitles
Dim rdsAllTitles_nu mRows
Set rdsAllTitles = Server.CreateOb ject("ADODB.Rec ordset")
rdsAllTitles.Ac tiveConnection = MM_IHEA_DNSLESS _STRING
rdsAllTitles.So urce = "SELECT * FROM qryAllTitles"
rdsAllTitles.Cu rsorType = 0
rdsAllTitles.Cu rsorLocation = 2
rdsAllTitles.Lo ckType = 1
rdsAllTitles.Op en()
rdsAllTitles_nu mRows = 0
%>
<%
Dim Repeat1__numRow s
Dim Repeat1__index
Repeat1__numRow s = -1
Repeat1__index = 0
rdsAllTitles_nu mRows = rdsAllTitles_nu mRows + Repeat1__numRow s
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitl ed 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="#CCCCC C">
<td><strong>Pub ID</strong></td>
<td><strong>Reg ion</strong></td>
<td><strong>Lan guage</strong></td>
<td><strong>Tit le</strong></td>
<td><strong>Sub ject</strong></td>
</tr>
<%
While ((Repeat1__numR ows <> 0) AND (NOT rdsAllTitles.EO F))
%>
<tr>
<td><%=(rdsAllT itles.Fields.It em("PubID").Val ue)%></td>
<td><%=(rdsAllT itles.Fields.It em("Region").Va lue)%></td>
<td><%=(rdsAllT itles.Fields.It em("LanguageNam e").Value)%> </td>
<td><%=(rdsAllT itles.Fields.It em("TitleName") .Value)%></td>
<td><%=(rdsAllT itles.Fields.It em("DiseaseName ").Value)%> </td>
</tr>
<%
Repeat1__index= Repeat1__index+ 1
Repeat1__numRow s=Repeat1__numR ows-1
rdsAllTitles.Mo veNext()
Wend
%>
</table>
</body>
</html>
<%
rdsAllTitles.Cl ose()
Set rdsAllTitles = Nothing
%>