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

分页显示的代码,页面可以跳转,但是点击上一页,下一页没有数据
<!--#include file="conn.ASP"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.L14 { LINE-HEIGHT: 140%
}
.L15 { LINE-HEIGHT: 150%
}
.orange { FONT-SIZE: 12px; COLOR: #ff6600; TEXT-DECORATION: none
}
.STYLE3 {color: #999999}
.style7 {COLOR: #333333; LINE-HEIGHT: 18px; FONT-FAMILY: "Verdana", "Arial", "Helvetica", "sans-serif"; font-weight: normal;}
.style9 {font-size: 12px}
body {
background-color: #FF9966;
}
-->
</style>
</head>
<body>
<table width="770" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td width="570" align="left" valign="top"><table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
  <tr>
  <td><a class="" 
  href="first.asp"></a><font class=""> &gt; </font><a href="qyxw.asp">厂家类别</a> <font class="">&gt; </font>所有厂家</td>
  </tr>
  <tr>
  <td><hr size="1"></td>
  </tr>
   
  </table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <td><table cellspacing=0 cellpadding=0 width="100%" border=0>
  <tbody>
  <tr>
  <td valign="top" class=nr-st-9pt-16line-shsj><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
<%

work=request("work")
sql="select * from HN_news where changjia='"&work&"'order by id desc"
set rsnews=server.createobject("adodb.recordset")
rsnews.open sql,conn,1,1

IF Not rsnews.eof Then
  proCount=rsnews.recordcount
rsnews.PageSize=20 '定义显示数目
if not IsEmpty(Request("ToPage")) then
ToPage=CInt(Request("ToPage"))
if ToPage>rsnews.PageCount then
rsnews.AbsolutePage=rsnews.PageCount
intCurPage=rsnews.PageCount
elseif ToPage<=0 then
rsnews.AbsolutePage=1
intCurPage=1
else
rsnews.AbsolutePage=ToPage
intCurPage=ToPage
end if
else
rsnews.AbsolutePage=1
intCurPage=1
end if

intCurPage=CInt(intCurPage)

For i = 1 to rsnews.PageSize
if rsnews.EOF then  
Exit For 
end if
%>
  <tr>
&nbs