asp分页显示,点击某页链接后打不开页面?
从数据库查询的数据进行分页显示,可以显示第一页,但不能从链接里打开,提示无法显示网业,这是为什么呢,请高手们看看代码错在那里?<%setconn=server.creat...
从数据库查询的数据进行分页显示,可以显示第一页,但不能从链接里打开,
提示无法显示网业,这是为什么呢,请高手们看看代码错在那里?
<%
set conn=server.createobject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & Server.MapPath("/acess/shuju.mdb")
conn.open connstr
set rs=server.createobject("adodb.recordset")
rs.open "select * from lwsc where suozaidi ='"& request.Form("suozaidi") &"'and zhuanye ='"& request.Form("zhuanye") &"' order by id DESC",conn,1,1
rs.pagesize=10
if request("page")<>"" then rs.AbsolutePage =Request("page")
RowCount =rs.pagesize
if not rs.eof then
Do While Not RS.EOF and RowCount>0
%>
</p>
<table width="856" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" bgcolor="#C2D6CC">
<tr bgcolor="#C2D6CC">
<td width="178" height="22" bgcolor="#C2D6CC"><span class="style11 style1">编号:<%=rs("id")%></span></td>
<td width="201"><span class="style11 style1">所在地:<%=rs("suozaidi")%></span></td>
<td width="469" rowspan="6" align="left" valign="top" bgcolor="#C2D6CC"><span class="style4"><strong><span class="style1 style4">自我介绍:</span></strong></span>
<span class="style1">
<p></p>
<%=rs("miaoshu")%></span> </td>
</tr>
<tr>
<td height="23"><span class="style11 style1">注册IP:<%=rs("ip")%></span></td>
<td><span class="style11 style1">专业:<%=rs("zhuanye")%></span></td>
</tr>
<tr>
<td height="20"><span class="style11 style1">注册时间:<%=rs("zcsj")%></span></td>
<td><span class="style11 style1">学历:<%=rs("xueli")%></span></td>
</tr>
<tr>
<td height="22"><span class="style11 style1">姓名:<%=rs("xingming")%></span></td>
<td><span class="style11 style1">电话:<%=rs("dianhua")%></span></td>
</tr>
<tr>
<td height="20"><span class="style11 style1">性别:<%=rs("xingbie")%></span></td>
<td><span class="style11 style1">QQ号码:<%=rs("qq")%></span></td>
</tr>
<tr>
<td height="22" colspan="2"><span class="style1">详细地址:<%=rs("dizhi")%></span></td>
</tr>
</table>
<p class="style1"> <span class="style1">
<%
RowCount = RowCount - 1
rs.movenext
loop
else
response.write("对不起,没有符合您查询条件的信息!")
end if
%>
<%
if rs.pagecount>1 then
%>
</span></p>
<table border="0">
<tr>
<td class="style1">信息分页:</td>
<%
for i=1 to rs.pagecount
%>
<td class="style1">
<a href="<%=request("script_name")%>?page=<%=i%>"><b><%=i%></b></a>
</td>
<%next%>
</tr>
</table>
<table width="464" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="71" align="center" bgcolor="#FFFFFF" class="style1"> </td>
<td width="278" align="center" bgcolor="#FFFFFF" class="style1"> </td>
<td width="115" align="center" bgcolor="#FFFFFF" class="style1"> </td>
</tr>
</table>
<%
end if
rs.close
Set rs=nothing
conn.close
Set conn=nothing
%>
已经直接改为现在页面地址了,但还是不行,问题好象出在这句:if request("page")<>"" then rs.AbsolutePage =Request("page") 我仍然看不出这句有什么毛病 展开
提示无法显示网业,这是为什么呢,请高手们看看代码错在那里?
<%
set conn=server.createobject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & Server.MapPath("/acess/shuju.mdb")
conn.open connstr
set rs=server.createobject("adodb.recordset")
rs.open "select * from lwsc where suozaidi ='"& request.Form("suozaidi") &"'and zhuanye ='"& request.Form("zhuanye") &"' order by id DESC",conn,1,1
rs.pagesize=10
if request("page")<>"" then rs.AbsolutePage =Request("page")
RowCount =rs.pagesize
if not rs.eof then
Do While Not RS.EOF and RowCount>0
%>
</p>
<table width="856" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" bgcolor="#C2D6CC">
<tr bgcolor="#C2D6CC">
<td width="178" height="22" bgcolor="#C2D6CC"><span class="style11 style1">编号:<%=rs("id")%></span></td>
<td width="201"><span class="style11 style1">所在地:<%=rs("suozaidi")%></span></td>
<td width="469" rowspan="6" align="left" valign="top" bgcolor="#C2D6CC"><span class="style4"><strong><span class="style1 style4">自我介绍:</span></strong></span>
<span class="style1">
<p></p>
<%=rs("miaoshu")%></span> </td>
</tr>
<tr>
<td height="23"><span class="style11 style1">注册IP:<%=rs("ip")%></span></td>
<td><span class="style11 style1">专业:<%=rs("zhuanye")%></span></td>
</tr>
<tr>
<td height="20"><span class="style11 style1">注册时间:<%=rs("zcsj")%></span></td>
<td><span class="style11 style1">学历:<%=rs("xueli")%></span></td>
</tr>
<tr>
<td height="22"><span class="style11 style1">姓名:<%=rs("xingming")%></span></td>
<td><span class="style11 style1">电话:<%=rs("dianhua")%></span></td>
</tr>
<tr>
<td height="20"><span class="style11 style1">性别:<%=rs("xingbie")%></span></td>
<td><span class="style11 style1">QQ号码:<%=rs("qq")%></span></td>
</tr>
<tr>
<td height="22" colspan="2"><span class="style1">详细地址:<%=rs("dizhi")%></span></td>
</tr>
</table>
<p class="style1"> <span class="style1">
<%
RowCount = RowCount - 1
rs.movenext
loop
else
response.write("对不起,没有符合您查询条件的信息!")
end if
%>
<%
if rs.pagecount>1 then
%>
</span></p>
<table border="0">
<tr>
<td class="style1">信息分页:</td>
<%
for i=1 to rs.pagecount
%>
<td class="style1">
<a href="<%=request("script_name")%>?page=<%=i%>"><b><%=i%></b></a>
</td>
<%next%>
</tr>
</table>
<table width="464" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="71" align="center" bgcolor="#FFFFFF" class="style1"> </td>
<td width="278" align="center" bgcolor="#FFFFFF" class="style1"> </td>
<td width="115" align="center" bgcolor="#FFFFFF" class="style1"> </td>
</tr>
</table>
<%
end if
rs.close
Set rs=nothing
conn.close
Set conn=nothing
%>
已经直接改为现在页面地址了,但还是不行,问题好象出在这句:if request("page")<>"" then rs.AbsolutePage =Request("page") 我仍然看不出这句有什么毛病 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询