请哪位朋友看一下我这个分页的程序哪里有错了?
错误类型:
Microsoft VBScript 运行时错误 (0x800A000B)
/flowersite/page.asp, 第 98 行
----------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
set conn=server.CreateObject ("adodb.connection")
conn.Open "driver={sql server};server=localhost;uid=sa;pwd=sa;database=hw"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title> 分页</title>
</head>
<body>
<table width="195" border="0" cellspacing="0" cellpadding="0">
<%
const maxperpage=2
dim totalput
dim currentpage
dim totalpages
if not isempty(request("page")) then
currentpage=cint(request("page"))
else
currentpage=1
end if
set rs=server.CreateObject ("adodb.recordset")
rs.Open "select * from flower",conn,1,1
if err.number<>0 then
Response.Write "数据库中无数据!"
end if
if rs.EOF and rs.BOF then
Response.Write "暂时没有更新鲜花!"
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,maxperapge,"page.asp"
else
if (currentpage-1)*maxperpage<totalput then
rs.Move (currentpage-1)*maxperpage
dim bookmark
bookmark=rs.Bookmark
showcontent
showpage totalput,maxperpage,"page.asp"
else
currentpage=1
showcontent
showpage totalput,maxperpage,"page.asp"
end if
end if
end if
sub showcontent
dim i
i=0
%>
<%
do while not rs.EOF
%>
<tr>
<td width="195">
<table width="189" height="94" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="80" rowspan="3"><img name="" src="<%=rs("f_pic")%>" width="84" height="93" alt=""></td>
<td width="109">花名<%=rs("f_name")%></td>
</tr>
<tr>
<td height="14">价格<%=rs("f_price")%></td>
</tr>
<tr>
<td valign="top">简介:<%=rs("f_info")%></td>
</tr>
</table></td>
</tr><%
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&" id=form1 name=form1>"
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 class='contents'>首页</a> "
Response.Write "<a href="&filename&"?page="¤tPage-1&" 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)&" class='contents'>"
Response.Write "下一页</a> <a href="&filename&"?page="&n&" 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&"种商品 "&maxperpage&"种商品/页</font> "
Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="¤tpage&">"
Response.Write " <input type='submit' class='contents' value='GO' name='cndok'></form>"
End Function
%>
</table>
</body>
</html>