主题:谁会改这段代码???
[color=0000FF]如何用for next 循环多行多列显示?????[/color]
代码如下:
--------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Set conn=Server.CreateObject("Adodb.Connection")
connstr="provider=Microsoft.JET.OLEDB.4.0;Data Source="&Server.MapPath("/data/data.mdb")
conn.open connstr
Set rs1=Server.CreateObject("Adodb.Recordset")
sql="Select * from Product ORDER BY ID ASC"
rs1.open sql,conn,1,1
%>
<%
rs1.pagesize=8
curpage=Request.QueryString("curpage")
if curpage="" then curpage=1
rs1.absolutepage=curpage
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>多行多列循环显示</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
[color=FF0000]<%
for i= 1 to rs1.pagesize
if rs1.eof then
exit for
end if
%>
<table width="100" border="0" cellspacing="15" cellpadding="0">
<tr>
<td><table border="0" cellpadding="5" cellspacing="0" class="bg4">
<tr>
<td height="110" bgcolor="#EEEEEE"><img src="<%=(rs1.Fields.Item("DefaultPicUrl").Value)%>" alt="点击查看详细信息" width="120" height="120" border="0"/></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#EEEEEE">产品型号:<%=(rs1.Fields.Item("Title").Value)%></td>
</tr>
</table></td>
</tr>
</table>
<%[/color]
rs.movenext
next
%>
<p> </p>
<p>
<%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1">首页</a>
<%end if%>
<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>">上一页</a>
<%end if%>
<%if rs1.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>">下一页</a>
<%end if%>
<%if rs1.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rs1.pagecount%>">尾页</a>
<%end if%>
</p>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
---------------------------------------------------------------------
[color=0000FF]如何用for next 循环多行多列显示?????[/color]
代码如下:
--------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Set conn=Server.CreateObject("Adodb.Connection")
connstr="provider=Microsoft.JET.OLEDB.4.0;Data Source="&Server.MapPath("/data/data.mdb")
conn.open connstr
Set rs1=Server.CreateObject("Adodb.Recordset")
sql="Select * from Product ORDER BY ID ASC"
rs1.open sql,conn,1,1
%>
<%
rs1.pagesize=8
curpage=Request.QueryString("curpage")
if curpage="" then curpage=1
rs1.absolutepage=curpage
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>多行多列循环显示</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
[color=FF0000]<%
for i= 1 to rs1.pagesize
if rs1.eof then
exit for
end if
%>
<table width="100" border="0" cellspacing="15" cellpadding="0">
<tr>
<td><table border="0" cellpadding="5" cellspacing="0" class="bg4">
<tr>
<td height="110" bgcolor="#EEEEEE"><img src="<%=(rs1.Fields.Item("DefaultPicUrl").Value)%>" alt="点击查看详细信息" width="120" height="120" border="0"/></td>
</tr>
<tr>
<td height="22" align="center" bgcolor="#EEEEEE">产品型号:<%=(rs1.Fields.Item("Title").Value)%></td>
</tr>
</table></td>
</tr>
</table>
<%[/color]
rs.movenext
next
%>
<p> </p>
<p>
<%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1">首页</a>
<%end if%>
<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>">上一页</a>
<%end if%>
<%if rs1.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>">下一页</a>
<%end if%>
<%if rs1.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rs1.pagecount%>">尾页</a>
<%end if%>
</p>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
---------------------------------------------------------------------
[color=0000FF]如何用for next 循环多行多列显示?????[/color]