?? backup3.asp
字號:
<%
if session("yida_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%
response.end
end if
%>
<html>
<head>
<title><%=dianming%> - 數據庫壓縮</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
background-color:#FFFFFF;
}
</style>
</HEAD>
<BODY>
<%if request("hid1")="" then%>
<form name="form1" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td> 壓縮數據庫</td>
<td align="right"> </td>
</tr>
</table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<tr>
<td height="30" colspan="2" align="center" class="category">你的空間只有支持fso才可以進行如下操作,否則你只能手動壓縮</td>
</tr>
<tr>
<td width="25%" height="30" align="right">當前數據庫路徑:</td>
<td width="75%" class="category">
<input type="text" name="mdbpath" size="30" value="backup/#yida_jxc31#.dat" readonly="true">
<input type="radio" value="false" checked name="ys"> 使用 Access 2000 數據庫
</td>
</tr>
<tr>
<td height="30" align="right"> </td>
<td class="category">
(為了安全,請注意用備份的數據庫文件來壓縮,不要用當前正在運行的數據庫文件)
</td>
</tr>
<tr class="a3">
<td align="center" colspan="2" class="category">
<input type="submit" value=" 確認壓縮 " class="button">
<input type="hidden" name="hid1" value="ok"></td>
</tr>
</table>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</form>
<%
else
'-----------------------------------------
Dim dbpath,boolIs97
dbpath="../"&request.form("mdbpath")
boolIs97=request.form("ys")
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
response.write"<script>alert('您的數據庫已經壓縮成功!');history.go(-1)</script>"
response.End()
Else
response.write"<script>alert('數據庫名稱或路徑不正確. 請重試!');history.go(-1)</script>"
response.End()
End If
End Function
'--------------------------------------------
end if
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -