rosebud289
Programmer
I have developed a web page that retrieves a list of topics and speakers from an Access database and displays them in a table. Some topics have multiple speakers, therefore I do not want the topics to be displayed again - just additional speakers. The code I have developed works fine for one or two speakers, but if there's more than two then the speaker's name is displayed above the table. Could you please let me know how to fix this problem? Thanks!
Example: TOPIC SPEAKER(S)
ABC's of Scuba Diving Joan Dickson
Mike Reynolds
George Stevens
Here's the code:
<% Dim Bool
header = Request.Form("header")
speaker_name = Request.Form("speaker_name")
lecture_time = Request.Form("lecture_time")
header = replace(header, "'", "")
q = "SELECT s_id, topic, description, min_time, first_name, last_name, headers, av_requirements FROM webupdates WHERE headers LIKE '%" & header & "%' AND S_ID LIKE '%" & speaker_name & "%' AND min_time LIKE '%" & lecture_time & "%' order BY topic, last_name, first_name"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open q, "DSN=access;"
%>
<%If NOT rs.EOF then%>
<% Bool = True %>
<% num = 0 %>
<%while not rs.EOF%>
<% num = num + 1 %>
<% if num mod 2 = 0 then %>
<% strColor = "#CCDDDD" %>
<% else %>
<% strColor = "#d1e3f8" %>
<% end if %>
<%noav=rs("av_requirements").value%>
<%if nodup<>rs("topic").value then%>
<tr>
<td bgcolor="<%=strColor%>" height="127" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font face="Arial, Helvetica, sans-serif"><%=rs("topic")%></font></b><font face="Arial, Helvetica, sans-serif"><br>
<%=rs("description")%></font></font></td>
<td valign="middle" bgcolor="<%=strColor%>">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><%=rs("min_time")%>
min.</font></div>
</td>
<td valign="middle" bgcolor="<%=strColor%>" align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<%if noav=" " then%>
<%Response.Write("see ")%>
<%else%><%=rs("av_requirements")%><% end if%>
</font> </td>
<td bgcolor="<%=strColor%>" valign="middle"><a href="bios_revised.asp?s_id=<%=rs("s_id")%>"><font face="Arial, Helvetica, sans-serif" size="2"><%=rs("first_name")%>
<%Response.Write(" ")%>
<%=rs("last_name")%></font></a><br>
<%else%>
<a href="bios_revised.asp?s_id=<%=rs("s_id")%>"><font face="Arial, Helvetica, sans-serif" size="2"><%=rs("first_name")%>
<%Response.Write(" ")%>
<%=rs("last_name")%></font></a> </td>
<%end if%>
<% nodup=rs("topic").value%>
<%rs.MoveNext%>
<br>
<%wend%>
<%else%>
<%Bool=False%>
<% Response.Write("No topics found.") %><br><br>
<% end if%>
</tr>
Example: TOPIC SPEAKER(S)
ABC's of Scuba Diving Joan Dickson
Mike Reynolds
George Stevens
Here's the code:
<% Dim Bool
header = Request.Form("header")
speaker_name = Request.Form("speaker_name")
lecture_time = Request.Form("lecture_time")
header = replace(header, "'", "")
q = "SELECT s_id, topic, description, min_time, first_name, last_name, headers, av_requirements FROM webupdates WHERE headers LIKE '%" & header & "%' AND S_ID LIKE '%" & speaker_name & "%' AND min_time LIKE '%" & lecture_time & "%' order BY topic, last_name, first_name"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open q, "DSN=access;"
%>
<%If NOT rs.EOF then%>
<% Bool = True %>
<% num = 0 %>
<%while not rs.EOF%>
<% num = num + 1 %>
<% if num mod 2 = 0 then %>
<% strColor = "#CCDDDD" %>
<% else %>
<% strColor = "#d1e3f8" %>
<% end if %>
<%noav=rs("av_requirements").value%>
<%if nodup<>rs("topic").value then%>
<tr>
<td bgcolor="<%=strColor%>" height="127" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font face="Arial, Helvetica, sans-serif"><%=rs("topic")%></font></b><font face="Arial, Helvetica, sans-serif"><br>
<%=rs("description")%></font></font></td>
<td valign="middle" bgcolor="<%=strColor%>">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><%=rs("min_time")%>
min.</font></div>
</td>
<td valign="middle" bgcolor="<%=strColor%>" align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<%if noav=" " then%>
<%Response.Write("see ")%>
<%else%><%=rs("av_requirements")%><% end if%>
</font> </td>
<td bgcolor="<%=strColor%>" valign="middle"><a href="bios_revised.asp?s_id=<%=rs("s_id")%>"><font face="Arial, Helvetica, sans-serif" size="2"><%=rs("first_name")%>
<%Response.Write(" ")%>
<%=rs("last_name")%></font></a><br>
<%else%>
<a href="bios_revised.asp?s_id=<%=rs("s_id")%>"><font face="Arial, Helvetica, sans-serif" size="2"><%=rs("first_name")%>
<%Response.Write(" ")%>
<%=rs("last_name")%></font></a> </td>
<%end if%>
<% nodup=rs("topic").value%>
<%rs.MoveNext%>
<br>
<%wend%>
<%else%>
<%Bool=False%>
<% Response.Write("No topics found.") %><br><br>
<% end if%>
</tr>