梦回大明海:asp的小问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 09:31:06
请高手帮我改一下,我想在网页中一行显示3个信息,看到好多人的帖子总是改不对。谢谢了!
<%
Set bobo=Server.CreateObject("ADODB.RecordSet")
sql="Select * From type"
bobo.open sql,conn,1,1
for i=1 to bobo.RecordCount
%>

<%
Set bobo=Server.CreateObject("ADODB.RecordSet")
sql="Select * From type"
bobo.open sql,conn,1,1
for i=1 to bobo.RecordCount
if int(r/3)=r/3 then
%><tr><%end if %><td>内容</td>
<%
r=r+1
bobo.movenext
next i
%></tr>

Set bobo=Server.CreateObject("ADODB.RecordSet")
sql="Select * From type"
bobo.open sql,conn,1,1
a=0
for i=1 to bobo.RecordCount
if a=3 then 换行符
....
a=a+1
if a>3 then a=0
next
-----------
这样就可以了。

Set bobo=Server.CreateObject("ADODB.RecordSet")
sql="Select * From type"
bobo.open sql,conn,1,1
response.write("<tr>")
i=1
do while not rs.eof
response.write("<td>....</td>")
i=i+1
if (i mod 3)=0 then
response.write("</tr><tr>")
end if
rs.movenext
response.write("</tr>")
loop

为了积分. 给你个正确的吧! 绝对标准!

<%
Set bobo=Server.CreateObject("ADODB.RecordSet")
sql="Select * From type"
bobo.open sql,conn,1,1
%>
<table width="100%" border="0" align="center">
<%do while not bobo.eof%>
<tr>
<%for j=1 to3%>
<td><%=bobo("字段")%></td>
<%bobo.movenext%>
<%next%>
</tr>
<%loop%>
</table>