<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Dim t5 Dim t5_cmd Dim t5_numRows '*************************************** create the record set, then select the data Set t5_cmd = Server.CreateObject ("ADODB.Command") t5_cmd.ActiveConnection = MM_top5_STRING t5_cmd.CommandText = "SELECT * FROM topfive ORDER BY id DESC" t5_cmd.Prepared = true Set t5 = t5_cmd.Execute t5_numRows = 0 %> <% '*************************************** sets up the repeat region Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 t5_numRows = t5_numRows + Repeat1__numRows '*************************************** create a variable for data that isn't in every record Dim TextShow TextShow = t5.Fields.Item("guilty_pleasure").Value %> <% '*************************************** the beginning of the "repeat region" While ((Repeat1__numRows <> 0) AND (NOT t5.EOF)) %> Top5 Tracks for the week of <%=(t5.Fields.Item("date").Value)%> <%=(t5.Fields.Item("date").Value)%> Top5
  1. <%=(t5.Fields.Item("songone").Value)%>
  2. <%=(t5.Fields.Item("songtwo").Value)%>
  3. <%=(t5.Fields.Item("songthree").Value)%>
  4. <%=(t5.Fields.Item("songfour").Value)%>
  5. <%=(t5.Fields.Item("songfive").Value)%>
  6. <% IF TextShow <>"" THEN%>
  7. Guilty Pleasure: <%=(t5.Fields.Item("guilty_pleasure").Value)%>
  8. <%ELSE%><%End If%>
<% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 t5.MoveNext() Wend '*************************************** end the repeat region %> <% t5.Close() Set t5 = Nothing '*************************************** closes the record set %>