📄 admin_data1.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%
if Session("Urule")<>"a" then
response.redirect "error.asp?id=admin"
end if
%>
<title>数据管理</title>
<link rel="stylesheet" type="text/css" href="oa1.css">
<BODY bgcolor="#DFEBFF" alink="#333333" vlink="#333333" link="#333333" topmargin="20">
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder">
<tr>
<th height=25 >
<B>压缩<span lang="zh-cn">红金羚</span>数据</B>( 需要FSO支持, )
</th>
</tr>
<form method="post" action="Admin_Data1.asp">
<tr align=center>
<td><br>输入数据库所在相对路径,并且输入数据库名称 </td>
</tr>
<tr align=center>
<td><input type="text" name="dbpath" value=redboy\redboy.mdb size="20"></td>
</tr>
<tr align=center><br>
<td><input type="checkbox" name="boolIs97" value="True">如果您使用 Access 97 数据库请选择<br>
(系统默认为 Access 2000 数据库)<br>
<input type="submit" value="开始压缩"><br></td>
</tr>
</form></table>
<%
Dim dbpath,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 = "你的数据库, " & dbpath & ", 已经压缩成功!" & vbCrLf
Else
CompactDB = "数据库名称或路径不正确. 请重试!" & vbCrLf
End If
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -