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

总是修改不好,麻烦各位帮忙,谢谢,关于查询到的结果翻页的问题
查询到的结果,我是每页显示10行,但查询结果有15行,点击下一页时总是不能正确显示,而是显示的全部信息,麻烦帮我改下代码吧,谢谢了


<body>

  <%

bname= "questioncxok.asp "
wtnr=request( "wtnr ")
wtssh=request( "wtssh ")
wtr=request( "wtr ")

Set   rs   =   Server.CreateObject( "ADODB.Recordset ")
sql= "select   *   from   question   WHERE   1=1   "

if   request( "wtnr ") <> " "   then
sql=sql   &   "   and   wtnr   like     '% "&wtnr& "% ' "  
end   if
if   request( "wtssh ") <> "ok "   then
sql=sql   &   "   and   wtssh   like   '% "&wtssh& "% ' "
end   if
if   request( "wtr ") <> "a "   then
sql=sql   &   "   and   wtr   like   '% "&wtr& "% ' "
end   if
sql=sql   &   "   order   by   ID   DESC "

rs.open   sql,conn,1
  if   not   rs.eof   and   not   rs.bof   then
rs.pagesize=10
page=request( "page ")
if   not   isnumeric(page)   then
page=1
end   if
page=clng(page)
if   err.number <> 0   then
page=1
end   if
if   page <1   then   page=1
if   page> rs.pagecount   then   page=rs.pagecount
href= "questioncx.asp "
rs.absolutepage=page
%>

    <div   align= "cneter ">
        <center>
    <div   align= "left ">
  <table   border= "1 "   width= "723 "   cellspacing= "0 "   cellpadding= "0 "   bordercolor= "#008000 "   bordercolordark= "#FFFFFF "   height= "28 "   style= "word-break:   break-all ">
       
            <tr>
                <td   height= "1 "   width= "35 "   bgcolor= "#CC6600 "   align= "center ">
                    <p   align= "center "> ID </td>      
                <td   height= "1 "   width= "267 "   bgcolor= "#CC6600 "   align= "center "> 问题内容 </td>
                <td   height= "1 "   width= "67 "   bgcolor= "#CC6600 "   align= "center "> 问题所属 </td>            
                <td   height= "1 "   width= "67 "   bgcolor= "#CC6600 "   align= "center "> 提问人 </td>            
                <td   height= "1 "   width= "40 "   bgcolor= "#CC6600 " &