ADODB.Recordset (0x800A0E78)对象关闭时,不允许操作。
问题如标题,出错行为标红色行
<!--#include file="../inc/fk_conn.asp"-->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css2.css" rel="stylesheet" type="text/css">
<script language=javascript>
function allcheck()
{
var a = document.getElementsByTagName("input");
if(a[0].checked==true){
for (var i=0; i<a.length; i++)
if (a[i].type == "checkbox") a[i].checked = false;
}
else
{
for (var i=0; i<a.length; i++)
if (a[i].type == "checkbox") a[i].checked = true;
}
}
</script>
</head>
<body>
<%dim action
action=request.QueryString("action")%>
.... <%'开始分页
Const MaxPerPage=12
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
select case action
case "no"
rs.open "select shop_books.bookname,shop_books.bookid,shop_pinglun.pinglunid,shop_pinglun.pingluncontent,shop_pinglun.pinglunname,shop_pinglun.pinglundate from shop_pinglun,shop_books where shop_books.bookid=shop_pinglun.bookid and shop_pinglun.shenhe=0 order by shop_pinglun.pinglundate desc",conn,1,1
case "yes"
rs.open "select shop_books.bookname,shop_books.bookid,shop_pinglun.pinglunid,shop_pinglun.pingluncontent,shop_pinglun.pinglunname,shop_pinglun.pinglundate from shop_pinglun,shop_books where shop_books.bookid=shop_pinglun.bookid and shop_pinglun.shenhe=1 order by shop_pinglun.pinglundate desc",conn,1,1
end select
if rs.eof And rs.bof then
%>
<table width="100%" border="1" align=center cellspacing="0" cellpadding="3" bordercolordark="#FFFFFF" bordercolorlight="#666666">
<tr>
<td bgcolor="#ece9d8"><div align="center"><font color=red>目前还没有未审阅评论!</font></div></td>
</tr>
</table>
<br>
<%else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"managepinglun.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"managepinglun.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"managepinglun.asp"
end if
end if
end if
sub showContent
dim i
dim i_mun
dim i_color
i=0:i_mun=1
%>
... <%
do while not rs.eof
if i_mun mod 2=1 then
i_color="#ffffff"
else
i_color="#eeeeee"
end if%>
<tr bgcolor=<%=i_color%>>
<td><div align="center"><input name="shenhe" type="checkbox" id="shenhe" value="<%=rs("pinglunid")%>"></div></td>
<td><div align="center"><%if len(rs("bookname"))>15 then
response.write "<a href=../book.asp?id="&rs("bookid")&" target=_blank>"&left(trim(rs("bookname")),12)&"...</a>"
else
response.write "<a href=../book.asp?id="&rs("bookid")&" target=_blank>"&trim(rs("bookname"))&"</a>"
end if
%></div></td>
<td><div align="center"><% if len(rs("pingluncontent"))>20 then
response.write "<a href=# onClick=""javascript:window.open('listpinglun.asp?id="&rs("pinglunid")&"','','width=300,height=120,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" title="&trim(rs("pingluncontent"))&">"&left(trim(rs("pingluncontent")),17)&"...</a>"
else
response.write "<a href=# onClick=""javascript:window.open('listpinglun.asp?id="&rs("pinglunid")&"','','width=300,height=120,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" title="&trim(rs("pingluncontent"))&">"&trim(rs("pingluncontent"))&"</a>"
end if%></div></td>
<td><div align="center"><%
response.write rs("pinglunname")
%></div></td>
<td><div align="center"><%
response.write month(rs("pinglundate"))&"/"&day(rs("pinglundate"))
%></div></td>
</tr>
<%
i_mun=i_mun+1
i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
.... <%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<form method=Post action="&filename&"?action="&action&">"
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首页 上一页</font> "
Else
Response.Write "<a href="&filename&"?page=1&action="&action&" class='contents'>首页</a> "
Response.Write "<a href="&filename&"?page="¤tPage-1&"&action="&action&" class='contents'>上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='contents'>下一页 尾页</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&action="&action&" class='contents'>"
Response.Write "下一页</a> <a href="&filename&"?page="&n&"&action="&action&" class='contents'>尾页</a>"
End If
Response.Write "<font class='contents'> 页次:</font><font class='contents'>"¤tPage&"</font><font class='contents'>/"&n&"页</font> "
Response.Write "<font class='contents'> 共有"&totalnumber&"条记录 "
Response.Write "<font class='contents'>"
Response.Write "</form>"
End Function
%>
</td>
</form>
.....