📄 admin_datazip.asp
字号:
<!--#include file="adminsession.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%closedatabase()%>
<head>
<link href="css.css" rel="stylesheet" type="text/css">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="350" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="<%=tdbgcolor%>">
<tr>
<td valign="top"><br>
<br>
<table width="90%" height="201" border="0" align=center cellpadding="5" cellspacing="1" bgcolor="<%=tdbgcolor%>">
<form action="admin_datazip.asp?action=CompressData" method="post">
<tr>
<td height=91><span class="red"><strong>注意:</strong></span><span class="blue">(此操作应经常进行,以便节约网络空间,加快系统的运行)</span>(空间需FSO支持)<br> <br>
输入数据库所在相对路径,并且输入数据库名称<br> <br>
(正在使用中数据库不能压缩,请选择备份数据库进行压缩操作) </td>
</tr>
<tr>
<td>压缩数据库
<input name="dbpath" type="text" value=database\dj70data.asp size="50">
<input type="submit" value="开始压缩"></td>
</tr>
<tr>
<td><%action=request("action")
if action="CompressData" then call CompressData()
sub CompressData()
dim dbpath
dbpath = request("dbpath")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
response.write(CompactDB(dbpath))
End If
end sub
Function CompactDB(dbPath)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
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%></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -