<!--#includefile="inc/conn.asp"--><%dimi,intPage,page,pre,last,filepathsetrs=server.CreateObject("adodb.recordset")sql="select*fromproduct"rs.PageSize=12rs.CursorLocation=3rs.Opensql,conn,0,2,1pre=truelast=truepage=trim(Request.QueryString("page"))iflen(page)=0thenintpage=1pre=falseelseifcint(page)=<1thenintpage=1pre=falseelseifcint(page)>=rs.PageCountthenintpage=rs.PageCountlast=falseelseintpage=cint(page)endifendifendififnotrs.eofthenrs.AbsolutePage=intpageendif%><!--循环开始--><table><%'行循环判断to后面是行数fori=1to3%><tr><%'列循环判断to后面是列数forj=1to4ifnotrs.eofthen%><td>显示内空</td><%rs.movenextelse%><td></td><%endifnext%></tr><%next%></table><!--循环体结束分页部分:--><tablewidth="99%"border="1"cellpadding="2"cellspacing="2"borderColorLight=#808080borderColorDark=#ffffff><tr><Tdwidth="10%">共有<%=rs.recordcount%>条记录</Td><%ifrs.pagecount>0then%><tdwidth="13%"align="left">当前页<%=intpage%>/<%=rs.PageCount%></td><%else%><tdwidth="41%"align="left">当前页0/0</td><%endif%><tdwidth="46%"align="right"><ahref="?page=1">首页</a>|<%ifprethen%><%ifrs.pagecount=1then'判断是否显示上页、下页Response.Write""else%><ahref="?page=<%=intpage-1%>">上页</a>|<%endif%><%iflastthen%><ahref="?page=<%=intpage+1%>">下页</a>|<%endifendif%><ahref="?page=<%=rs.PageCount%>">尾页</a>|转到第<selectname="sel_page"><%fori=1tors.PageCountifi=intpagethen%><optionvalue="?page=<%=i%>"selected><%=i%></option><%else%><optionvalue="?page=<%=i%>"><%=i%></option><%endifnext%></select>页</font></td></tr></table>