asp读取acess数据后分页 数据是读出来了,但分页错误,点击没反应还显示缺少对象
<!--#includefile="conn.asp"--><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN...
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body{
font-size: 12px;
vertical-align: top;
line-height: 10px ;
background: #010101;
}
-->
</style>
</head>
<body>
<%
dim rs,sql
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from maillist order by id desc"
rs.open sql,conn,1,1
%>
<div width="712" height="270" border="0" Style="background:#E7E7E7;" valign="top" />
<%
if not(rs.eof and rs.bof) then
rs.pagesize=8'每页显示10条记录
ps=rs.pagesize
RC_Num=rs.recordcount'总记录数
pageAll=rs.pagecount'总页数
page=request("page")
if not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>pageAll then
page=pageAll
end if
rs.Absolutepage=page
end if
if RC_Num>0 then
rs.Absolutepage=page
for i=1 to ps
if rs.eof then
%>
<%
else
%>
<ul><li><%=rs("email")%>,</li></ul>
<%
end if
if not rs.eof then
rs.movenext
end if
next
%>
<div align="center" style="position:absolute; left:650px; top:400px; border:0px; solid #ccc;">
当前页次:<%=page%> / <%=pageAll%> 共 <%=pageAll%> 页 共 <%=RC_Num%> 条记录 每页显示<%=ps%>条记录 <br></br>
<%
if page<=1 then
%>
[首页][上一页]
<%
else
%>
<a href="javascript:getList(1)">[首页]</a> <a href="javascript:getList(<%=(page-1)%>)">[下一页]</a>
<%
end if
if page>=pageAll then
%>
[下一页][尾页]
<%
else
%>
<a href="javascript:getList(<%=(page+1)%>)">[下一页]</a> <a href="javascript:getList(<%=pageAll%>)">[尾页]</a>
<%end if
dim pag
%>
<select name="jump" class="jump" onchange="getList(this.options[this.selectedIndex].value)">
<%
for pag=1 to pageAll
if int(page)=pag then
%>
<option value="<%=page%>" selected="selected"><%=pag%></option>
<%else%>
<option value="<%=pag%>"><%=pag%></option>
<%end if
next
%>
</select>
</div>
<%
else
%>
暂无订阅
</div>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if%>
</body>
</html>
以上是代码,请好心人帮忙看看到底错在哪里,万分感谢!!
另求大家有没有可用的php邮件列表(简单可用,有订阅、退订、导出邮件地址功能就行,谢谢) 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body{
font-size: 12px;
vertical-align: top;
line-height: 10px ;
background: #010101;
}
-->
</style>
</head>
<body>
<%
dim rs,sql
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from maillist order by id desc"
rs.open sql,conn,1,1
%>
<div width="712" height="270" border="0" Style="background:#E7E7E7;" valign="top" />
<%
if not(rs.eof and rs.bof) then
rs.pagesize=8'每页显示10条记录
ps=rs.pagesize
RC_Num=rs.recordcount'总记录数
pageAll=rs.pagecount'总页数
page=request("page")
if not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>pageAll then
page=pageAll
end if
rs.Absolutepage=page
end if
if RC_Num>0 then
rs.Absolutepage=page
for i=1 to ps
if rs.eof then
%>
<%
else
%>
<ul><li><%=rs("email")%>,</li></ul>
<%
end if
if not rs.eof then
rs.movenext
end if
next
%>
<div align="center" style="position:absolute; left:650px; top:400px; border:0px; solid #ccc;">
当前页次:<%=page%> / <%=pageAll%> 共 <%=pageAll%> 页 共 <%=RC_Num%> 条记录 每页显示<%=ps%>条记录 <br></br>
<%
if page<=1 then
%>
[首页][上一页]
<%
else
%>
<a href="javascript:getList(1)">[首页]</a> <a href="javascript:getList(<%=(page-1)%>)">[下一页]</a>
<%
end if
if page>=pageAll then
%>
[下一页][尾页]
<%
else
%>
<a href="javascript:getList(<%=(page+1)%>)">[下一页]</a> <a href="javascript:getList(<%=pageAll%>)">[尾页]</a>
<%end if
dim pag
%>
<select name="jump" class="jump" onchange="getList(this.options[this.selectedIndex].value)">
<%
for pag=1 to pageAll
if int(page)=pag then
%>
<option value="<%=page%>" selected="selected"><%=pag%></option>
<%else%>
<option value="<%=pag%>"><%=pag%></option>
<%end if
next
%>
</select>
</div>
<%
else
%>
暂无订阅
</div>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if%>
</body>
</html>
以上是代码,请好心人帮忙看看到底错在哪里,万分感谢!!
另求大家有没有可用的php邮件列表(简单可用,有订阅、退订、导出邮件地址功能就行,谢谢) 展开
2个回答
展开全部
传播最好的ASP ACCESS分页代码
set rs = conn.execute("select count(m_id) as HH_sum_vote_log from HH_say "&HS_haveid2&"")
HH_sum_vote_log = rs("HH_sum_vote_log")
rs.close
set rs = nothing
if HH_sum_vote_log>0 then
HH_sum_page_result=Round(HH_sum_vote_log/HH_pagesize,2)
HH_sum_page=cint(HH_sum_vote_log/HH_pagesize)
if HH_sum_page<HH_sum_page_result then
HH_sum_page=HH_sum_page+1
end if
else
HH_sum_page=1
end if
if isnumeric(HH_admpg) = false then
echo ("页码有误,将为您转向第一页!")
end if
if HH_admpg="" or HH_admpg<1 then
page = 1
else
page = cint(HH_admpg)
end if
if page < 1 or page > HH_sum_page then
echo ("页码有误,将为您转向第一页!")
end if
HH_sumpagemax="desc"
if page=HH_sum_page and page<>1 and HH_sum_page<>1 then
HH_pagesize_no=(HH_pagesize*HH_sum_page)-HH_sum_vote_log
if not HH_pagesize_no=0 then
HH_pagesize=HH_pagesize-HH_pagesize_no
HH_sumpagemax="asc"
end if
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from (select top "&HH_pagesize&" * from (select top "&page*HH_pagesize&" * from HH_say "&HS_haveid&" order by Val([m_id]) "&HH_sumpagemax&") order by Val([m_id])) order by Val([m_id]) desc"
rs.open sql,conn,1,1
if rs.eof then
echo ("<script language='javascript'>alert('本项目没有访客留言,请返回!');window.history.go(-1);</script>")
rs.close
set rs=nothing
exit sub
end if
do while not rs.eof
......................
rs.movenext
loop
<div id="H_page">第<%=page%>/<%=HH_sum_page%>页 共<%=HH_sum_vote_log%>条记录<%
if page=1 then%>
首页
<%else%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=1" id="lianjie" class="zw">首页</a>
<%end if
if page<>1 then
%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=page-1%>" id="lianjie" class="zw">上一页</a>..
<%else%>
上一页
<%end if
pg_px_top=page-5
pg_px_botton=page+5
for i=pg_px_top to pg_px_botton
if i<1 or i>HH_sum_page then
else
if i=page then
response.write i
else%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=i%>"><%=i%></a>
<% end if
end if
next
if page<>HH_sum_page then
%>
..<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=page+1%>" id="lianjie" class="zw">下一页</a>
<%else%>
下一页
<%end if
if page<>HH_sum_page then%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=HH_sum_page%>" id="lianjie" class="zw">尾页</a>
<%else%>
尾页
<%end if
echo ("</div>")
rs.close
set rs=nothing
%>
set rs = conn.execute("select count(m_id) as HH_sum_vote_log from HH_say "&HS_haveid2&"")
HH_sum_vote_log = rs("HH_sum_vote_log")
rs.close
set rs = nothing
if HH_sum_vote_log>0 then
HH_sum_page_result=Round(HH_sum_vote_log/HH_pagesize,2)
HH_sum_page=cint(HH_sum_vote_log/HH_pagesize)
if HH_sum_page<HH_sum_page_result then
HH_sum_page=HH_sum_page+1
end if
else
HH_sum_page=1
end if
if isnumeric(HH_admpg) = false then
echo ("页码有误,将为您转向第一页!")
end if
if HH_admpg="" or HH_admpg<1 then
page = 1
else
page = cint(HH_admpg)
end if
if page < 1 or page > HH_sum_page then
echo ("页码有误,将为您转向第一页!")
end if
HH_sumpagemax="desc"
if page=HH_sum_page and page<>1 and HH_sum_page<>1 then
HH_pagesize_no=(HH_pagesize*HH_sum_page)-HH_sum_vote_log
if not HH_pagesize_no=0 then
HH_pagesize=HH_pagesize-HH_pagesize_no
HH_sumpagemax="asc"
end if
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from (select top "&HH_pagesize&" * from (select top "&page*HH_pagesize&" * from HH_say "&HS_haveid&" order by Val([m_id]) "&HH_sumpagemax&") order by Val([m_id])) order by Val([m_id]) desc"
rs.open sql,conn,1,1
if rs.eof then
echo ("<script language='javascript'>alert('本项目没有访客留言,请返回!');window.history.go(-1);</script>")
rs.close
set rs=nothing
exit sub
end if
do while not rs.eof
......................
rs.movenext
loop
<div id="H_page">第<%=page%>/<%=HH_sum_page%>页 共<%=HH_sum_vote_log%>条记录<%
if page=1 then%>
首页
<%else%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=1" id="lianjie" class="zw">首页</a>
<%end if
if page<>1 then
%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=page-1%>" id="lianjie" class="zw">上一页</a>..
<%else%>
上一页
<%end if
pg_px_top=page-5
pg_px_botton=page+5
for i=pg_px_top to pg_px_botton
if i<1 or i>HH_sum_page then
else
if i=page then
response.write i
else%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=i%>"><%=i%></a>
<% end if
end if
next
if page<>HH_sum_page then
%>
..<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=page+1%>" id="lianjie" class="zw">下一页</a>
<%else%>
下一页
<%end if
if page<>HH_sum_page then%>
<a href="?class=<%=HH_admclass%><%=HH_idshow%>&pg=<%=HH_sum_page%>" id="lianjie" class="zw">尾页</a>
<%else%>
尾页
<%end if
echo ("</div>")
rs.close
set rs=nothing
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你试试:
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body{
font-size: 12px;
vertical-align: top;
line-height: 10px ;
background: #010101;
}
-->
</style>
</head>
<body>
<%
dim rs,sql
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from maillist order by id desc"
rs.open sql,conn,1,1
%>
<div width="712" height="270" border="0" Style="background:#E7E7E7;" valign="top" />
<%
if not(rs.eof and rs.bof) then
rs.pagesize=8'每页显示10条记录
ps=rs.pagesize
RC_Num=rs.recordcount'总记录数
pageAll=rs.pagecount'总页数
page=request("page")
if not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>pageAll then
page=pageAll
end if
rs.Absolutepage=page
end if
if RC_Num>0 then
rs.Absolutepage=page
for i=1 to ps
if rs.eof then
%>
<%
else
%>
<ul><li><%=rs("email")%>,</li></ul>
<%
end if
if not rs.eof then
rs.movenext
end if
next
%>
<div align="center" style="position:absolute; left:650px; top:400px; border:0px; solid #ccc;">
当前页次:<%=page%> / <%=pageAll%> 共 <%=pageAll%> 页 共 <%=RC_Num%> 条记录 每页显示<%=ps%>条记录 <br></br>
<%
if page<=1 then
%>
[首页][上一页]
<%
else
%>
<a href="?page=1">[首页]</a> <a href="?page=<%=(page-1)%>">[上一页]</a>
<%
end if
if page>=pageAll then
%>
[下一页][尾页]
<%
else
%>
<a href="?page=<%=(page+1)%>">[下一页]</a> <a href="?page=<%=pageAll%>">[尾页]</a>
<%end if
dim pag
%>
<select name="jump" class="jump" onchange="window.location.href='?page='+this.options[this.selectedIndex].value">
<%
for pag=1 to pageAll
if int(page)=pag then
%>
<option value="<%=page%>" selected="selected"><%=pag%></option>
<%else%>
<option value="<%=pag%>"><%=pag%></option>
<%end if
next
%>
</select>
</div>
<%
else
%>
暂无订阅
</div>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if%>
</body>
</html>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body{
font-size: 12px;
vertical-align: top;
line-height: 10px ;
background: #010101;
}
-->
</style>
</head>
<body>
<%
dim rs,sql
set rs=server.CreateObject("ADODB.Recordset")
sql="select * from maillist order by id desc"
rs.open sql,conn,1,1
%>
<div width="712" height="270" border="0" Style="background:#E7E7E7;" valign="top" />
<%
if not(rs.eof and rs.bof) then
rs.pagesize=8'每页显示10条记录
ps=rs.pagesize
RC_Num=rs.recordcount'总记录数
pageAll=rs.pagecount'总页数
page=request("page")
if not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>pageAll then
page=pageAll
end if
rs.Absolutepage=page
end if
if RC_Num>0 then
rs.Absolutepage=page
for i=1 to ps
if rs.eof then
%>
<%
else
%>
<ul><li><%=rs("email")%>,</li></ul>
<%
end if
if not rs.eof then
rs.movenext
end if
next
%>
<div align="center" style="position:absolute; left:650px; top:400px; border:0px; solid #ccc;">
当前页次:<%=page%> / <%=pageAll%> 共 <%=pageAll%> 页 共 <%=RC_Num%> 条记录 每页显示<%=ps%>条记录 <br></br>
<%
if page<=1 then
%>
[首页][上一页]
<%
else
%>
<a href="?page=1">[首页]</a> <a href="?page=<%=(page-1)%>">[上一页]</a>
<%
end if
if page>=pageAll then
%>
[下一页][尾页]
<%
else
%>
<a href="?page=<%=(page+1)%>">[下一页]</a> <a href="?page=<%=pageAll%>">[尾页]</a>
<%end if
dim pag
%>
<select name="jump" class="jump" onchange="window.location.href='?page='+this.options[this.selectedIndex].value">
<%
for pag=1 to pageAll
if int(page)=pag then
%>
<option value="<%=page%>" selected="selected"><%=pag%></option>
<%else%>
<option value="<%=pag%>"><%=pag%></option>
<%end if
next
%>
</select>
</div>
<%
else
%>
暂无订阅
</div>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if%>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询