% newstype=request("newstype") sql="select * from news where newstype='"&newstype&"' and flag=1 order by shijian desc" Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open sql,conn,3,3 rs.PageSize = 30 '定义每页文章显示数 TotalPage = rs.PageCount '共有页面数 totalPut=rs.recordcount '共有记录数 intPageNo = Request("PageNo") '当前页 If intPageNo = Empty Then intPageNo = 1 Else if isNumeric(intPageNo) then intPageNo = CInt(intPageNo) If intPageNo > TotalPage Then intPageNo = TotalPage if intPageNo < 0 then intPageNo=1 End If if rs.eof then intPageNo=0 else rs.AbsolutePage = intPageNo '显示当前页 end if %>
![]() |