请教分页的一个问题! 先谢谢大家了!
以下是代码:<!--#include file="conn.asp"-->
<%
dim page_size
dim page_no
dim page_total
dim wenjianming
set rs=server.createobject("adodb.recordset")
'sql = "select * from yao where Ys="红色""
sql="select * from yao where Ys = '红色'"
wenjianming="goso.asp"
page_size=5
if request.querystring("page_no")="" then
page_no=1
else
page_no=cint(request.querystring("page_no"))
end if
rs.pagesize=page_size
page_total=rs.pagecount
if not(rs.bof or rs.eof) then
rs.absolutepage=page_no
end if
dim i
i=page_size
response.write "共<font color=blue>" & page_total & "</font>页 每页<font color=red>" & page_size & "</font>条记录 当前<font color=red>" & page_no & "</font>|<font color=red>" & page_total & "</font>页 "
if page_total=1 then
response.write "首页|上一页|下一页|尾页"
else
response.write "<a href=" & wenjianming & "?page_no=1&typeid="&typeid&"&ntypeid="&ntypeid&"&ys="&ys&">首页</a>|"
if page_no-1>0 then
response.write "<a href=" & wenjianming & "?page_no=" & page_no-1 & "&typeid="&typeid&"&ntypeid="&ntypeid&"&ys="&ys&">上一页</a>|"
else
response.write "上一页|"
end if
if page_no+1<=page_total then
response.write "<a href=" & wenjianming & "?page_no=" & page_no+1 & "&typeid="&typeid&"&ntypeid="&ntypeid&"&ys="&ys&">下一页</a>|"
else
response.write "下一页|"
end if
response.write "<a href=" & wenjianming & "?page_no=" & page_total & "&typeid="&typeid&"&ntypeid="&ntypeid&"&ys="&ys&">尾页</a>"
end if
%>
<table cellspacing=0 width="100%" border=1 cellpadding="1" bordercolor="#3D5FC2" align="center">
<tr bgcolor="#efefefef">
<td height="20" width="126" align="center">药品名称</td>
<td width="107" align="center">药品颜色</td>
<td height="20" width="191" align="center">产地</td>
<td width="132" align="center">特点</td>
<td height="20" width="146" align="center">价格</td>
<td height="20" width="125" align="center">使用方法</td>
<td height="20" width="146" align="center">详细介绍</td>
<td height="20" width="125" align="center">图片</td>
</tr>
<%
do while not rs.eof and i>0
i=i-1
%>
<tr>
<td height="21" width="126"><%=rs("Ym")%></td>
<td height="21" width="107"><%=rs("Ys")%></td>
<td height="21" width="191"><%=rs("Cd")%></td>
<td height="21" width="132"><%=rs("Gx")%></td>
<td height="21" width="146"><%=rs("Jg")%></td>
<td height="21" width="125"><%=rs("Ff")%></td>
<td height="21" width="146"><%=rs("Js")%></td>
<td height="21" width="125"><img src="<%=rs("LPattern")%>" width="80" height="50"></td>
</tr>
<%
rs.movenext
loop
rs.close
Set Rs=Nothing
%>
</table>
当运行的时候会显示
ADODB.Recordset 错误 '800a0e78'
对象关闭时,不允许操作。
/hao2/xianshi.asp,行 18 是什么原因呀?