This is straight from an include I have. It holds code for a
recordset and javascript:
<%
Dim rs_subcatList
Dim rs_subcatList_cmd
Dim rs_subcatList_numRows
Set rs_subcatList_cmd = Server.CreateObject ("ADODB.Command")
rs_subcatList_cmd.ActiveConnection = MM_CharonCart_STRING
rs_subcatList_cmd.CommandText = "SELECT * FROM Categories
WHERE ParentiD = 1 ORDER BY CategoryID"
rs_subcatList_cmd.Prepared = true
Set rs_subcatList = rs_subcatList_cmd.Execute
rs_subcatList_numRows = 0
%>
<%
Dim RepeatSubCat__numRows
Dim RepeatSubCat__index
RepeatSubCat__numRows = -1
RepeatSubCat__index = 0
rs_subcatList_numRows = rs_subcatList_numRows +
RepeatSubCat__numRows
%>
<body>
<table width="156" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><a href="1boys.asp"><img
src="_images/but-boys-col.jpg" alt="Boys" name="Boys" width="156"
height="65" border="0" id="Boys"
onMouseOver="MM_swapImage('Boys','','_images/but-boys-col.jpg',1)"
onMouseOut="MM_swapImgRestore()" /></a></td>
</tr>
<tr>
<td><table width="156" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><img src="_images/bar-EBECF5-top.gif"
width="156" height="5"></td>
</tr>
<tr>
<td><table width="156" border="0" cellspacing="0"
cellpadding="5">
<tr>
<td bgcolor="#CCCCCC">
<p class="navlinks">
<%
While ((RepeatSubCat__numRows <> 0) AND (NOT
rs_subcatList.EOF))
%>
<a href="1boysdrill.asp?<%=
Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) &
"MCID=" & rs_subcatList.Fields.Item("CategoryID").Value
%>"><%=(rs_subcatList.Fields.Item("Category").Value)%></a><br>
<%
RepeatSubCat__index=RepeatSubCat__index+1
RepeatSubCat__numRows=RepeatSubCat__numRows-1
rs_subcatList.MoveNext()
Wend
%>
<a href="1boysdrill.asp?MCID=1">Boys - all
products</a>
</p>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%
rs_subcatList.Close()
Set rs_subcatList = Nothing
%>
AND, I have just noticed that it has an opening body tag, but
no closing body tag, yet it still works fine! I've edited it a bit,
so copying this may make the table collapse when pasted in DW, but
you get the idea.
Mat