<!--#include file="head.asp"-->
<!--#include file="conn.asp"--> <!--"../"表示上一级目录-->
<!--#include file="function.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from detail"
rs.open sql,conn,1,1
mypage=request("mypage") '传值出错,接受不到,检查不出
filename="show.asp"
howmany=rs.recordcount
if mypagesize="" then
mypagesize=5
end if
if IsEmpty(mypage) then
mypage=1
elseif mypage>mypagecount then
mypage=mypagecount
end if
rs.pagesize=mypagesize
mypagecount=cint(rs.pagecount) '页数出问题,每页5条记录,应该4页,却只有2页
mypage=cint(mypage)
rs.absolutepage=mypage '这里是26行
%>
<hr width="80%" size="1" noshade color="#45DE4D">
<table width="80%" height="354" border="0" align="center">
<tr>
<td height="350" valign="top"><table width="100%" border="0" cellspacing="0" class="hstyle1">
<tr bgcolor="FCDAD5" class="style1">
<td width="324" height="21" bgcolor="FCDAD5" class="hstyle1">总留言数:
<% response.Write(howmany)%> 总页数:<% response.Write(mypagecount)%>页</td>
<td width="444" rowspan="2" bgcolor="#FFDAB9"></td>
</tr>
<tr bgcolor="C9E4D6" class="style1">
<td height="21" bgcolor="C9E4D6"><div align="left">回首页</div></td>
</tr>
</table>
<table width="100%" height="4%" border="0.5" cellpadding="0" cellspacing="0" bordercolor="#333333" class="hstyle1">
<tr class="style1">
<td width="61" height="24"><div align="center">状态</div></td>
<td width="61" height="24"><div align="center">心情</div></td>
<td width="227" height="24"><div align="center">发言主题</div></td>
<td width="129" height="24"><div align="center">发言者</div></td>
<td width="64" headers="24"><div align="center">发表时间</div></td>
<td width="46" height="24"><div align="center">回复</div></td>
<td width="46" height="24"><div align="center">阅读</div></td>
<td width="138" height="24"><div align="center">最后回复</div></td>
</tr>
</table>
<%
do while not rs.eof and howmanyrecs< rs.pagesize
%>
<table width="100%" height="3%" border="0" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="hstyle1">
<tr class="style1">
<td width="61" height="25"><div align="center"></div></td>
<td width="61" height="25"><div align="center"></div></td>
<td width="227" height="25"><div align="center"></div>
<div align="left"><%=rs("theme")%></div></td>
<td width="129" height="25"><div align="center"><%=rs("name")%></div></td>
<td width="64" headers="24"><div align="center"><%=rs("publishtime")%></div></td>
<td width="46" height="25"><div align="center"></div></td>
<td width="46" height="25"><div align="center"></div></td>
<td width="138" height="25"><div align="center"></div></td>
</tr>
</table>
<%
rs.movenext
howmanyrecs=howmanyrecs+1
loop
rs.close
%>
<form name="form1" method="post" action="">
<table width="100%" height="30" border="0" class="hstyle1">
<tr> <!--以下调用function页面的sub page-->
<td height="26" class="style1"><div align="right"><% call page(filename,mypage,mypagecount)%> 跳到第
<input name="pmypage" type="text" id="pmypage" value="1" size="3" height="15">
页
<input type="submit" name="Submit" value="GO">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
调用的page函数:
sub page(filename,mypage,mypagecount)
dim str
str="您当前在第"&mypage&"页"
if (mypage="" or mypage=1) then
str=str&"首页 | 上一页"
elseif mypage>1 then
str=str&"<a href='"&filename&"?mypage=1'>首页</a> | <a href='"&filename&"?mypage="&mypage-1&"'>上一页</a>"
end if
if mypage=mypagecount then
str=str& " | 下一页 | 尾页"
elseif mypage<mypagecount then
str=str&" | <a href='"&filename&"?mypage="&mypage+1&"'>下一页</a> | <a href='"&filename&"?mypage="&mypagecount&"'>尾页</a>"
end if
response.Write(str)
end sub
%>
F12运行时能显示,但是点下一页时就提示
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/visitor's book/visitor's book/show.asp, 第 26 行 就是rs.absolutepage=mypage
好象没接受到值,我该怎么修改呢?请各位帮忙看一下好吗?谢谢了~~!