多列显示后无法分页

mark1088 2010-01-23 08:38:38
Dreamweaver中可以实现三列显示,但是无法分页,预览提示“错误类型:
ADODB.Recordset (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

请问只是哪里出了问题的呢?


<body>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>

<table width="289" border="1">
<tr>
<%
i=1
do while not Recordset1.eof
%>
<td width="200" nowrap><%=(Recordset1.Fields.Item("UsrID").Value)%></td>
<%if i = 3 then
response.write "</tr> <tr>"
i=0
end if
i=i+1
Recordset1.movenext
loop
%>
</tr>
</table>


<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
...全文
26 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
mark1088 2010-01-23
  • 打赏
  • 举报
回复
高,实在是高!
虽然自己看的还没有十分明白,但套进去可以实现了,太感谢了!先结案给分了再自己研究~~
Atai-Lu 2010-01-23
  • 打赏
  • 举报
回复
你用了两次循环,自然就没法控制分页了
Atai-Lu 2010-01-23
  • 打赏
  • 举报
回复
<table width="289" border="1">
<tr>
<%
dim i
i=0
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
if i mod 3=0 and i>0 then Response.Write("</tr><tr>")
i=i+1
%>


<td width="200" nowrap> <%=(Recordset1.Fields.Item("UsrID").Value)%> </td>

<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>

</tr>
</table>
mark1088 2010-01-23
  • 打赏
  • 举报
回复
但是如果这样就可以分页显示,但是只有一列
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<table width="289" border="1">
<tr>

<td width="200" nowrap><%=(Recordset1.Fields.Item("UsrID").Value)%></td>

</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>


而我要的是多列显示,且可以分页的,哪位高手可以指点指点,非常感谢了,分不够可以再加哦

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧