⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminys.asp

📁 一个不错的论坛原代码
💻 ASP
字号:
<!--#include file="Connections.asp" -->
<!--#include file="adminaccess.asp" -->

<body  <%=background%> >

 <% if Request.QueryString("action")="do" then
 currf=request.form("currf")
currf = server.mappath(currf)
 ys=request.form("ys")
 Const JET_3X = 4
strDBPath = left(currf,instrrev(currf,"\"))
on error resume next
 Set objfso = Server.CreateObject("Scripting.FileSystemObject")
if err then 
	err.clear
response.write "<div class=tdc>不能建立fso对象,请确保你的空间支持fso:!"
response.end
	end if
 if objfso.fileexists(currf) then 
 Set Engine = CreateObject("JRO.JetEngine")
on error resume next
 If ys = 1 Then
 Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & currf, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "fytemp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & currf, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "fytemp.mdb"
End If
objfso.CopyFile strDBPath & "fytemp.mdb",currf
objfso.DeleteFile(strDBPath & "fytemp.mdb")
Set objfso = nothing
Set Engine = nothing
if err then 
	err.clear
response.write "<div class=tdc>错误:很抱歉,由于系统错误,压缩失败:!"
response.end
	end if
response.write "<div class=tdc>压缩数据库成功</div>"
response.end
Else
response.write "<div class=tdc>错误:找不到数据库文件!"
response.end
End If
end if


  
%>
<table  border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
    
<form name="form1" method="POST" action="?action=do">
     <tr align="center"> 
      <td colspan="2" <%=tColor%> class=tdc1 height=22>
      压缩数据库</td>
    </tr>
    <tr align="center"> 
      <td <%=tColor%> class=tdc1 height=22 colspan="2">你的空间只有支持fso才可以进行如下操作,否则你只能手动压缩</td>
    </tr>

      <tr>
      <td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>数据库路径:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input type="text" name="currf" size="20" value="data/feiyue.mdb"> 
        </td>
    </tr>
    <tr>
      <td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc colspan="2">
      <p align="left"><input type="radio" value="1" name="ys">使用 Access 97 数据库<input type="radio" value="2" checked name="ys">使用   
      Access 2000 数据库</td>  
    </tr>
  <tr>
      <td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc colspan="2">
      <p align="left">(为了安全,请注意用备份的数据库文件来压缩,不要用当前正在运行的数据库文件)</td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc> </td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input type="submit" name="Submit" value="提交" class=bdtj>
        <input type="reset" name="Submit2" value="重置" class=bdtj>
      </td>
    </tr>
  </table>
  </form>


<%

 conn.close
set conn=nothing%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -