asp排列mdb数据 1行横排10个

来源:百度知道 编辑:UC知道 时间:2024/06/14 20:52:40
不知道是否一定要用到表格

数据库 表名 gzk

数据 280条
id pic
... ...

1行横排10个 共28行

需要配合表格
<!--#include file="数据连接页面.asp"-->
'把如下内容贴在需要显示的位置即可
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<%
set rs=server.createobject("ADODB.Recordset")
sql="select * from gzk"
rs.open sql,conn,1,1
for i=1 to rs.recordcount
%>
<tr>
<%
for j=1 to 10 '如果1行横排5个,就把10变为5
if not rs.eof then
%>
<td height=25><%=rs("pic")%></td>
<%
rs.movenext
end if
next
%>
</tr>
<%next%>
</table>