<%@ LANGUAGE="VBSCRIPT" %> <%=ForumName%>--管理页面 <% if not master then Errmsg=Errmsg+"
"+"
  • 本页面为管理员专用,请登陆后进入。" call Error() else %> <% dim rs,sql dim tmprs dim allarticle dim Maxid dim topic,username,dateandtime,body call main() set rs=nothing conn.close set conn=nothing end if sub main() %> align=center>
    >
    欢迎<%=session("mastername")%>进入管理页面
    <%call leftmenu()%>


    输入数据库所在相对路径,并且输入数据库名称
    如果使用 Access 97 数据库请选择
    (默认为 Access 2000 数据库)

    <% Dim dbpath,boolIs97 dbpath = request("dbpath") boolIs97 = request("boolIs97") If dbpath <> "" Then dbpath = server.mappath(dbpath) response.write(CompactDB(dbpath,boolIs97)) End If %>

    <% end sub %> <% Const JET_3X = 4 Function CompactDB(dbPath, boolIs97) Dim fso, Engine, strDBPath strDBPath = left(dbPath,instrrev(DBPath,"\")) Set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists(dbPath) Then Set Engine = CreateObject("JRO.JetEngine") If boolIs97 = "True" Then Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb;" _ & "Jet OLEDB:Engine Type=" & JET_3X Else Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb" End If fso.CopyFile strDBPath & "temp.mdb",dbpath fso.DeleteFile(strDBPath & "temp.mdb") Set fso = nothing Set Engine = nothing CompactDB = "你的数据库, " & dbpath & ", 已经压缩成功!" & vbCrLf Else CompactDB = "数据库名称或路径不正确. 请重试!" & vbCrLf End If End Function %>