Forum Moderators: open
<tr>
<%
' Write out the records contained in this page
Dim i
For i=1 To pagesize
If Not rs.EOF Then
%><td align="center"><img border="0" src="images/products/<%=rs("Product_Image")%>" width="100" height="158" style="border-style: dotted; border-width: 3"><br>
<font face="Tahoma" size="2"><%=rs("Product_Name")%></font>
</br>
<a href="<%=rs("Sound")%>"><font face="Tahoma" size="2">click here to listen</font></a>
<%
rs.MoveNext
END IF
NEXT
%>
</tr>
thanks in advance
<tr>
<%
' Write out the records contained in this page
Dim y
Response.write "<TD><TABLE><TR>"
If Not rs.EOF Then
Do While Not rs.EOF
%>
<td align="center"><img border="0" src="images/products/<%=rs("Product_Image")%>" width="100" height="158" style="border-style: dotted; border-width: 3"><br>
<font face="Tahoma" size="2"><%=rs("Product_Name")%></font>
</br>
<a href="<%=rs("Sound")%>"><font face="Tahoma" size="2">click here to listen</font></a>
</td>
<%
y = y + 1
If y = 3 then
Response.write "</TR><TR>"
End IF
rs.MoveNext
Loop
'Now close out the last row and then the table and td
Response.write "</TR></TABLE></TD>"
END IF
%>
</tr>
'Note: This is not a very "smart" loop. If you had 9 or say an even number like 10 you might want to get a little fancier with how to determine when/where to break as well as how many columns there are going to be. That too could be dynamic
<html>
<head>
<title></title>
</head>
<body>
<%
db = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=whatever.mdb"
set rs = server.createobject("adodb.recordset")
sql = "select * from table"
rs.open sql, db
if not rs.eof then
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<%
do while not rs.eof
Count = Count + 1
%>
<tr>
<td><font face="Tahoma" size="2"><%if not rs.eof then%><%=rs("Field1")%><%rs.movenext%><%end if%></font></td>
<td><font face="Tahoma" size="2"><%if not rs.eof then%><%=rs("Field1")%><%rs.movenext%><%end if%></font></td>
<td><font face="Tahoma" size="2"><%if not rs.eof then%><%=rs("Field1")%><%rs.movenext%><%end if%></font></td>
</tr>
<%
loop
%>
</table>
<%
end if
rs.close
set rs = nothing
%>
</body>
</html>