📄 compress.asp
字号:
<%
if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")>1 then
response.write "<br><p align=center>你没有操作权限!</p>"
response.end
end if
end if
%>
<!--#include file="conn.asp"-->
<%
Dim boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
response.write(CompactDB(dbpath,boolIs97))
End If
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 = "<link href=style.css rel=stylesheet><body bgcolor=#418598><center><br><br>数据库压缩完成,请进行其他操作!<br><br><a href=javascript:history.go(-1)>>> 返 回 <<</a></center></body>"
Else
CompactDB = "<link href=style.css rel=stylesheet><body bgcolor=#418598><center><br><br>数据库路径或名称不正确,请重试!<br><br><a href=javascript:history.go(-1)>>> 返 回 <<</a></center></body>" & vbCrLf
End If
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -