日期:2014-05-17  浏览次数:21059 次

ASP分页难题求解 ,搜索结果点"下一页"却显示全部记录???详细给高分>>

<%


keys=request.form( "key ")
set   conn=server.createobject( "adodb.connection ")
conn.open   "driver={microsoft   access   driver   (*.mdb)};dbq= "&server.mappath( "phone.mdb ")
exec= "select   *   from   bill   where   phone   like   '% "&keys& "% '   or   phone2   like   '% "&keys& "% ' "
set   rs=server.CreateObject( "adodb.recordset ")
rs.open   exec,conn,1,1
set   rs1=server.CreateObject( "adodb.recordset ")
sql= "SELECT   sum(Bill.charge)   as   www   FROM   Bill   WHERE   phone   like   '% "&keys& "% ' "

rs1.open   sql,conn,1,1


rs.pagesize=20
zongye=rs.pagecount
page=int(request( "page "))
if   page <=0   then   page=1
if   request( "page ")= " "   then   page=1
rs.absolutepage=page


%>
<html>
<head>
<title> 话费查询 </title>
</head>
<body   bgcolor= "#FFFFFF "   text= "#000000 "   topmargin= "20 "   bottommargin= "0 ">

<table   border= "0 "   width= "100% "   id= "table1 "   bgcolor= "#D5EAFD ">
<tr>
<td   width= "167 "> 您查询的分机号码是: </td>
<td   width= "276 ">   <%response.write(keys)   %> </td>
<td   width= "90 "> 话费总计: </td>
<td> <%=   rs1( "www ")   %>   </td>
</tr>
</table>

<table   width= "100% "   border= "1 "   cellpadding= "0 "   cellspacing= "0 ">
<p> &nbsp;
    <tr>
        <td   width= "10% "   height= "31 "   bgcolor= "#F7F7F7 "> 拨打日期 </td>
<td   width= "10% "   height= "31 "   bgcolor= "#F7F7F7 "> 拨打时间 </td>
        <td   width= "10% "   height= "31 "   bgcolor= "#F7F7F7 "> 通话时长 </td>
        <td   width= "10% "   height= "31 "   bgcolor= "#F7F7F7 "> 通话费用 </td>
        <td     width= "10% "   height= "31 "   bgcolor= "#F7F7F7 "> 拨打类型 </td>
        <td   width= "10% "   height= "31 "   bgcolor= "#F7F7F7 "> 机主姓名 </td>
        <td   height= "31 "   bgcolor= "#F7F7F7 "> 部门 </td>
    </tr>


<%
if   rs.eof   or     rs.bof   then
response.write( "没有找到记录! ")
else


for   i=1   to   rs.pagesize
%>


    </p>
    <tr>
        <td   width= "10% "> <%=rs( "startdate ")%> </td