<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock
set cschat=server.createobject("ffcschat.cssbchat")

my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
set cschat=nothing
application.unlock

if my_level-application( ConstStr & "_superlevel")<>0 then response.end

On Error Resume Next%>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'><META content="text/html; charset=gb2312" http-equiv=content-type>
<link rel="stylesheet" type="text/css" href="chat.css">
<style>p{color:#000000;text-align:left;margin-left:10px;margin-right:20px;margin-top:10px;margin-bottom:0px}</style>
<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=3 >
  <table cellspacing=0 cellpadding=0 align=center width=100% height=100%>
  <tr><td valign=center>
  <table width=80% cellspacing=0 cellpadding=0 style="border:'1px solid navy'">
  <tr><td class=navy2>服务器压缩后数据库的读测试</td></tr>
<%db_table=request("db_table")
if db_table<>"" and db_table<>"calls" and db_table<>"guestbook" then
ConnStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+server.mappath("backup/global.asa")+";DefaultDir='';DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=15;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
Set conn = Server.CreateObject("ADODB.CONNECTION")
Set rs = Server.CreateObject("ADODB.RecordSet")
conn.Open ConnStr
sql = "SELECT * FROM "&db_table
rs.Open sql, conn, 1, 1
if err then
  err.clear
  response.redirect("showerr.asp?errtext=打开数据库失败！")
  rs.Close
  Set rs = Nothing
  conn.Close
  Set conn = Nothing
  response.end
end if

Rs.pagesize=40
page=Request("page")
if not IsNumeric(page) or page="" then page=1
if (page-1)<0 then
  page=Rs.pagecount
elseif (page-Rs.pagecount)>0 then
  page=1
end if
Rs.AbsolutePage=page
RowCount =Rs.pagesize

response.write "<tr><td><table border=1>"
do while not rs.eof and RowCount>0
  response.write "<tr>"
  for i=0 to rs.fields.count - 1
    response.write "<td>" & rs(i).value & "　</td>"
    if err then exit for  
  next
  rs.movenext
  RowCount=RowCount-1
  if err then exit do
loop
response.write "</table><tr><td><center>共" & Rs.pagecount & _
  "页 当前第"&page&"页 [<a href=dbreadtest.asp?db_table="&db_table&"&page="&(page-1)&" >上一页</a>] [<a href=dbreadtest.asp?db_table="&db_table&"&page="&(page+1)&" >下一页</a>]</center>"
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing%>
<%else%>
<form action=dbreadtest.asp method=post><tr><td><p>
  在使用服务器端压缩数据库时，为了防止服务器端配置不兼容导致压缩失败数据库不可用。请在<font color=red>第一次</font>使用后，对压缩后的数据库(backup/global.asa)做读测试！</p>
  <p><center><font color=red>读取的表单</font>：<input type=text name=db_table size=20 maxlength=20 value='user' >
  <select name='table_select' onchange='document.forms[0].db_table.value=this.value'>
  <option value='user'>选择</option>
  <option value='user'>----</option>
  <option value='user'>用户</option>
  <option value='room'>房间</option>
  <option value='action'>动作</option>
  <option value='sysparam'>参数</option>
  </select>
  </center></p>
  <p><center><input class=navy1 type=submit name=cmdYes value='提交' >
  <input class=navy1 type=reset name=cmdcancel value='重置' ></center></form>
<%end if%>
</td></tr>
</table><br>[<a href='javascript:history.go(-1)'>后退</a>]</table></body></html>