%@ CODEPAGE = "936" %> <% '================================= ' ' 阿江酷站访问统计系统 ' Ajiang info@ajiang.net ' www.ajiang.net ' ' 版权所有·抄袭挪用必究 ' '================================= %> <% if session.Contents("master") <> true then Response.Redirect "help.asp?error=你不是管理员,无权进入本页面。" '****************** 创建数据对象 ****************** set conn=server.createobject("adodb.connection") DBPath = Server.MapPath(connpath) conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rs = Server.CreateObject("ADODB.Recordset") set connip=server.createobject("adodb.connection") DBPath = Server.MapPath(ipconnpath) connip.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rsip = Server.CreateObject("ADODB.Recordset") if Request("type")="go" then tall=clng(Request("tall")) '如果有“启动”标记,则创建up_date字段并全部标记为未更新。 if Request("start")="yes" then 'on error resume next sql="select count(*) as tall from view where vwhere='未知'" temprs=conn.Execute(sql) tall=temprs("tall") set temprs=nothing sql="ALTER TABLE view ADD COLUMN up_date bit" conn.execute(sql) sql="update view set up_date=0" conn.execute(sql) elseif tall=0 then sql="select count(*) as tall from view where vwhere='未知' and up_date=0" temprs=conn.Execute(sql) tall=temprs("tall") set temprs=nothing end if '****************** 更新主数据库 ****************** on error resume next sql="select top 50 * from view where vwhere='未知' and up_date=0" rs.Open sql,conn,3,2 if rs.EOF then rs.Close sql="ALTER TABLE view drop up_date" conn.execute(sql) Response.Write "完成" else do while not rs.EOF rs("vwhere")=cadd(rs("vip")) rs("up_date")=1 rs.Update rs.MoveNext loop rs.Close sql="select count(*) as thavenot from view where vwhere='未知' and up_date=0" temprs=conn.Execute(sql) thavenot=temprs("thavenot") thave=tall-thavenot ttlong=int(thave*300/tall) %>
|
|