<%@ 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) %> <%=countname%>-更新主数据库

更 新 进 度


已更新/所有: <%=thave%>/<%=tall%>
如果程序没有继续进行,请点击→[>继续]
如果要暂停这一次更新,请点击→[暂停]

登录进入更新页面,点击“继续上次未完成的更新”即可继续本次更新。
<% end if else '如果type<>go %> 本页功能是用新的IP库更新主记录库,请从管理员页面进入,误闯无罪。 <% end if '****************** 关闭数据对象 ****************** set rs=nothing conn.Close set conn=nothing set rsip=nothing connip.Close set connip=nothing '****************** 自定义函数 ******************** function cadd(sip) ipnow=cip(sip) sql="select * from ip where (onip<=" & ipnow & " and offip>=" & ipnow & ")" rsip.Open sql,connip,1,1 if rsip.EOF then cadd="未知" else cadd=rsip("addj") end if rsip.Close end function function cip(sip) tip=cstr(sip) sip1=left(tip,cint(instr(tip,".")-1)) tip=mid(tip,cint(instr(tip,".")+1)) sip2=left(tip,cint(instr(tip,".")-1)) tip=mid(tip,cint(instr(tip,".")+1)) sip3=left(tip,cint(instr(tip,".")-1)) sip4=mid(tip,cint(instr(tip,".")+1)) cip=cint(sip1)*256*256*256+cint(sip2)*256*256+cint(sip3)*256+cint(sip4) end function function islast() islast=true on error resume next sql="select * from view where up_date=0" conn.execute(sql) if err<>0 then islast=false end function %>