www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/data/ysdata.asp
<!--#include file="../config.asp" --> <% call connend() call chkqx(3,13) mytit="压缩数据库" 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 call head() %> <link href="../inc/mm.css" rel="stylesheet" type="text/css" /> <table width="99%" border="0" align="right" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF" class="wb"> <tr> <td id="tit"><a href="../main.asp">后台管理</a>>>压缩数据库 </tr> <tr> <td bgcolor="#F4F4F2"></td> </tr> <tr> <td bgcolor="#E2F1FA"> <form action="<%= request.ServerVariables("PATH_INFO") %>"> <div align="center"> <p>请输入数据路径和名称<br> <br> <input name="dbpath" type="text" class="inp" value="<%= mydb %>" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"> <br> <br> <input type="checkbox" name="boolIs97" value="True"> 如果是ac97,请打上勾 <br> <i> (默认是Access 2000以后的版本)</i><br> <br> <input name="submit" type="submit" class="button_1" onclick="syscz()" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'" value="提交"> <br /> <% Dim dbpath,boolIs97 dbpath = request("dbpath") boolIs97 = request("boolIs97") If dbpath <> "" Then dbpath = pdlj(dbpath) response.write(CompactDB(dbpath,boolIs97)) End If %> </p> </div> </form> </td> </tr> </table> <% call foot() %>