<!--#include file="../conn2.asp"-->
<!--#include file="set.asp"-->
<LINK 
href="css.css" type=text/css rel=stylesheet><%
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 = "你的数据库已经被压缩" & vbCrLf
Else
CompactDB = "你输入的数据库路径或名称未找到，请重试" & vbCrLf
End If

End Function
%>
<table width="87%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="F6F6F6">
  <form action=zip_mdb.asp method="POST">
  <tr> 
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="2" bgcolor="#FFFFFF" class="norightbuttonborder3">压缩数据库</td>
  </tr>
  <tr> 
    <td width="47%" bgcolor="#FFFFFF"><div align="right">原来的数据库路径：</div></td>
    <td width="53%" bgcolor="#FFFFFF"><input name="dbpath" type="text" class="textbox_shiixian_hui" value="..\data\esung.mdb" size="30"></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2"> <div align="center"> 
          <input name="submit" type="submit" class="button" value="确认压缩">
      </div></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 
%> 
 
 
 
 







