分页错误。。。!
<%Setrs=Server.CreateObject("Adodb.Recordset")sql="Select*frominfo"rs.opensql,conn,1,...
<%
Set rs=Server.CreateObject("Adodb.Recordset")
sql="Select * from info"
rs.open sql,conn,1,1
%>
<%
dim curpage,rs
rs.pagesize=5 '每页记录条数
curpage=Request.QueryString("curpage") '将URL参数curpage传给curpage变量
rs.absolutepage=clng(curpage) '将本页设为curpage设置的页数,将curpage变量的数值指定为当前页.
%>
<%
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<%=rs("record_info")%><br>
<%
rs.movenext
next
%>
<br>
<div>当前第<%=curpage%>页,共有<%=rs.pagecount%>页,共有:<%=rs.recordcount%>条记录</div>
<%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1">首页</a>
<%end if%>
<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>">上一页</a>
<%end if%>
<%if rs.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>">下一页</a>
<%end if%>
<%if rs.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rs.pagecount%>">尾页</a>
<%end if%>
ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/asp/example/page.asp,行 14
14行是:rs.absolutepage=clng(curpage) 展开
Set rs=Server.CreateObject("Adodb.Recordset")
sql="Select * from info"
rs.open sql,conn,1,1
%>
<%
dim curpage,rs
rs.pagesize=5 '每页记录条数
curpage=Request.QueryString("curpage") '将URL参数curpage传给curpage变量
rs.absolutepage=clng(curpage) '将本页设为curpage设置的页数,将curpage变量的数值指定为当前页.
%>
<%
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<%=rs("record_info")%><br>
<%
rs.movenext
next
%>
<br>
<div>当前第<%=curpage%>页,共有<%=rs.pagecount%>页,共有:<%=rs.recordcount%>条记录</div>
<%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1">首页</a>
<%end if%>
<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>">上一页</a>
<%end if%>
<%if rs.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>">下一页</a>
<%end if%>
<%if rs.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rs.pagecount%>">尾页</a>
<%end if%>
ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/asp/example/page.asp,行 14
14行是:rs.absolutepage=clng(curpage) 展开
2个回答
展开全部
<%
ip=request.servervariables("REMOTE_ADDR")
dim i,intPage,page,pre,last,filepath,saves
saves="true"
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from [shop] where save="&saves
rs.PageSize = 8 //(Yoko:这里设定每页显示的记录数
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 //(Yoko:'这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
------------------------------------------循环输出内容
%>
<%
rs.movenext
next
%>
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<%if rs.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs.PageCount%></td>
<%else%>
<td width="18%" align="left">当前页0/0</td>
<%end if%>
<td width="69%" align="right"> <a href="dingdan.asp?page=1" target="main">首页</a>|
<%if pre then%>
<a href="dingdan.asp?page=<%=intpage -1%>" target="main">上页</a>|
<%end if%>
<%if last then%>
<a href="dingdan.asp?page=<%=intpage +1%>" target="main">下页</a> |
<%end if%>
<a href="dingdan.asp?page=<%=rs.PageCount%>" target="main">尾页</a>|转到第
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="dingdan.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="dingdan.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font> </td>
</tr>
</table>
ip=request.servervariables("REMOTE_ADDR")
dim i,intPage,page,pre,last,filepath,saves
saves="true"
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from [shop] where save="&saves
rs.PageSize = 8 //(Yoko:这里设定每页显示的记录数
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 //(Yoko:'这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
------------------------------------------循环输出内容
%>
<%
rs.movenext
next
%>
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<%if rs.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs.PageCount%></td>
<%else%>
<td width="18%" align="left">当前页0/0</td>
<%end if%>
<td width="69%" align="right"> <a href="dingdan.asp?page=1" target="main">首页</a>|
<%if pre then%>
<a href="dingdan.asp?page=<%=intpage -1%>" target="main">上页</a>|
<%end if%>
<%if last then%>
<a href="dingdan.asp?page=<%=intpage +1%>" target="main">下页</a> |
<%end if%>
<a href="dingdan.asp?page=<%=rs.PageCount%>" target="main">尾页</a>|转到第
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="dingdan.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="dingdan.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font> </td>
</tr>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询