?? compress.asp
字號:
<!--#include file="conn.asp"-->
<%if session("bjxadmin")="" then
response.Write "<script language='javascript'>alert('網(wǎng)絡(luò)超時或您還沒有登陸!');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>2 then
response.Write "<p align=center><font color=red>您沒有此項目管理權(quán)限!</font></p>"
response.End
end if
end if
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td align="center" background="../images/admin_bg_1.gif"><b><font color="#ffffff">壓縮數(shù)據(jù)庫 ( 需要FSO支持,F(xiàn)SO相關(guān)幫助請看微軟網(wǎng)站 ) </font></b></td>
</tr>
<tr>
<td width=100% bgcolor=#E8F1FF>
<font color=red>注意:輸入數(shù)據(jù)庫所在相對路徑,并且輸入數(shù)據(jù)庫名稱(正在使用中數(shù)據(jù)庫不能壓縮,請選擇備份數(shù)據(jù)庫進(jìn)行壓縮操作)</font>
</td>
</tr>
<tr>
<%
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 = "您所指定的數(shù)據(jù)庫, " & dbpath & ", 已經(jīng)被壓縮" & vbCrLf
Else
CompactDB = "您所輸入的數(shù)據(jù)庫路徑或名稱未找到,請重試" & vbCrLf
End If
End Function
%>
<form name="compress" method="post" action="compress.asp">
<td width=100% bgcolor=#E8F1FF>
壓縮數(shù)據(jù)庫:<input type="text" name="dbpath" size="20" value="../data/shop.asa">
<input type="submit" name="submit" value="開始壓縮">
</td>
</tr>
<tr>
<td width=100% bgcolor=#E8F1FF>
<input type="checkbox" name="boolIs97" value="True">
如果使用 Access 97 數(shù)據(jù)庫請選擇(默認(rèn)為 Access 2000 數(shù)據(jù)庫)
</td>
</tr>
</form>
<%
Dim dbpath,boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
response.write(CompactDB(dbpath,boolIs97))
End If
%>
</td></tr></table>
<!--#include file="bjxfoot.asp"-->
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -