<%'开始分页 Const MaxPerPage=18 dim totalPut dim CurrentPage dim TotalPages dim j if Not isempty(request("page")) then currentPage=Cint(request("page")) else currentPage=1 end if type1=request.QueryString("type") set res=server.createobject("adodb.recordset") res.open "select * from infor where type='"&type1&"'",conn,1,1 if err.number<>0 then response.write "数据库中无数据" end if if res.eof And res.bof then Response.Write "

您还没有添加新闻!

" else totalPut=res.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"hwss1.asp" else if (currentPage-1)*MaxPerPage <%do while not res.eof%> <%i=i+1 if i>=MaxPerPage then Exit Do res.movenext loop res.close set res=nothing%>
编号 标题 发布时间 操作
<%=trim(res("til"))%> <%=res("data")%> ">删除
<% End Sub Function showpage(totalnumber,maxperpage,filename) Dim n If totalnumber Mod maxperpage=0 Then n= totalnumber \ maxperpage Else n= totalnumber \ maxperpage+1 End If Response.Write "
" Response.Write "

" If CurrentPage<2 Then Response.Write "首页 上一页 " Else Response.Write "首页 " Response.Write "上一页 " End If If n-currentpage<1 Then Response.Write "下一页 尾页" Else Response.Write "" Response.Write "下一页 尾页" End If Response.Write " 页次:"&CurrentPage&"/"&n&"页 " Response.Write " 共有"&totalnumber&"条信息 " End Function %>