<% maxPerPage=15'每页显示的记录数 myKeyword=Request("myKeyword") page=Request("page") if (page="" or isempty(page)) then page=1 thisUrl="news.asp?myKeyword="&myKeyword session("oldUrl")=thisUrl&"&page="&page set rs=server.createobject("adodb.recordset") sql="select * from file where filesort=20" if not (myKeyword="" or isempty(myKeyword) ) then sql=sql&" and title like '%"&myKeyword&"%'" end if sql=sql&" order by id desc" 'response.write sql 'response.End rs.open sql,conn,1,1 rs.pagesize=MaxPerPage %> <% dim rsID i=1 if not (rs.eof or err) then rs.move (page-1)*maxPerPage do while not (rs.eof or err) rsID=rs("id") %>
<%=formatdatetime(rs("adddate"),2)%> <%=rs("hitNum")%>
<%=convert(left(rs("introduce"),120))%>...
<% i=i+1 if i>maxPerPage then exit do rs.moveNext loop %>
<%if page>1 then%>上一页<%end if%> <%if rs.recordCount>page*maxPerPage then%>下一页<%end if%>