📄 admin_backdb.asp
字号:
<%@ codepage ="936" %>
<%
if session("admin_name")="" then
response.write "<SCRIPT language=JavaScript>alert('对不起,你没有权限打开此页!');"
response.write"this.location.href='../login.asp';</SCRIPT>"
response.end
end if
%>
<!--#include file="conn.asp" -->
<BODY topMargin=0 leftmargin="0" marginheight="0">
<link rel="stylesheet" type="text/css" href="../style.css">
<% if Request.QueryString("action")="back" then
currf=request.form("currf")
currf=server.mappath(currf)
backf=request.form("backf")
backf=server.mappath(backf)
backfy=request.form("backfy")
' 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.Folderexists(backf) then
else
Set fy=objfso.CreateFolder(backf)
end if
objfso.copyfile currf,backf& "\"& backfy
response.write "<div class=tdc>备份数据库成功,您的数据库备份路径为" &backf& "\"& backfy&"</div>"
response.end
end if
%>
<%
if Request.QueryString("action")="back" then
currf=request.form("currf")
currf=server.mappath(currf)
backf=request.form("backf")
backf=server.mappath(backf)
backfy=request.form("backfy")
on error resume next
Set objfso = Server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>"
response.end
end if
if objfso.Folderexists(backf) then
else
Set fy=objfso.CreateFolder(backf)
end if
objfso.copyfile currf,backf& "\"& backfy
response.write "<script>alert(""备份数据库成功"");history.back();</script>"
end if
if Request.QueryString("action")="ys" 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 "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>"
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 & "tourtemp.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 & "tourtemp.mdb"
End If
objfso.CopyFile strDBPath & "fytemp.mdb",currf
objfso.DeleteFile(strDBPath & "tourtemp.mdb")
Set objfso = nothing
Set Engine = nothing
if err then
err.clear
response.write "<script>alert(""错误:很抱歉,由于系统错误,压缩失败:!"");history.back();</script>"
response.end
end if
response.write "<script>alert(""压缩数据库成功"");history.back();</script>"
response.end
Else
response.write "<script>alert(""错误:找不到数据库文件!"");history.back();</script>"
response.end
End If
end if
if Request.QueryString("action")="reload" then
currf=request.form("currf")
currf=server.mappath(currf)
backf=request.form("backf")
if backf="" then
response.write "<script>alert(""请输入您要恢复的数据库全名"");history.back();</script>"
else
backf=server.mappath(backf)
end if
on error resume next
Set objfso = Server.CreateObject("Scripting.FileSystemObject")
if err then
err.clear
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>"
response.end
end if
if objfso.fileexists(backf) then
objfso.copyfile ""&backf&"",""&currf&""
response.write "<script>alert(""恢复数据库成功"");history.back();</script>"
response.end
else
response.write "<script>alert(""错误:备份目录下无您的备份文件!"");history.back();</script>"
response.end
end if
end if
set rs=nothing
%>
<form name="form1" method="POST" action="admin_backdb.asp?action=back">
<div align="center">
<center>
<br>
<table border="1" cellpadding="5" bordercolorlight="#326598" bordercolordark="#ffffff" width="98%" id="AutoNumber1" cellspacing="0">
<tr>
<td width="100%" height="25" background="../images/admin_bg_1.gif"><font color="#FFFFFF"><strong>备份数据库</strong></font></td>
</tr>
<tr>
<td width="100%" bgcolor="#FBFDFF"><font color="#FF0000">你的空间只有支持fso才可以进行如下操作,否则你只能手动备份</font></td>
</tr>
<tr>
<td width="100%" bgcolor="#FBFDFF">数据库路径:
<span style="background-color: #F7FFF7">
<input type="text" name="currf" size="30" value="../../etwl_dbs/etwldbs.mdb">
</span> 备份数据目录:
<span style="background-color: #F7FFF7">
<input type="text" name="backf" size="20" value="dbback"></span></td>
</tr>
<tr>
<td width="100%" bgcolor="#FBFDFF">数据库名称:
<span style="background-color: #F7FFF7">
<input type="text" name="backfy" size="20" value="back.mdb">
<input type="submit" name="Submit" value="备份" >
<input type="reset" name="Submit2" value="重置" > </span>
</td>
</tr>
</table>
</center>
</div>
</form>
<form name="form1" method="POST" action=admin_backdb.asp?action=ys>
<div align="center">
<center>
<table border="1" cellpadding="5" bordercolorlight="#326598" bordercolordark="#ffffff" width="98%" id="AutoNumber2" cellspacing="0">
<tr>
<td width="100%" height="25" background="../images/admin_bg_1.gif"><font color="#FFFFFF"><strong>压缩数据库</strong></font></td>
</tr>
<tr>
<td width="100%">
<span style="background-color: #F7FFF7">你的</span>空间只有支持fso才可以进行如下操作,否则你只能手动压缩</td>
</tr>
<tr>
<td width="100%">
<span style="background-color: #F7FFF7">数</span>据库路径:<span style="background-color: #F7FFF7">
<input type="text" name="currf" size="20" value="dbback/back.mdb">
<input type="submit" name="Submit" value="压缩" >
<input type="reset" name="Submit2" value="重置" > </span><input type="radio" value="1" name="ys">使用
Access 97 数据库<input type="radio" value="2" checked name="ys">使用 Access
2000 数据库</td>
</tr>
<tr>
<td width="100%"><font color="#FF0000">(为了安全,请注意用备份的数据库文件来压缩,不要用当前正在运行的数据库文件)</font></td>
</tr>
</table>
</center>
</div>
</form>
<form name="form1" method="POST" action="admin_backdb.asp?action=reload">
<div align="center">
<center>
<table border="1" cellpadding="5" cellspacing="0" bordercolorlight="#326598" bordercolordark="#ffffff" width="98%" id="AutoNumber3">
<tr>
<td width="100%" height="25" background="../images/admin_bg_1.gif"><font color="#FFFFFF"><strong>恢复数据库</strong></font></td>
</tr>
<tr>
<td width="100%"><font color="#FF0000">你的空间只有支持fso才可以进行如下操作,否则你只能手动恢复</font></td>
</tr>
<tr>
<td width="100%">当前数据库路径:<span style="background-color: #F7FFF7">
<input type="text" name="currf" size="30" value="../../etwl_dbs/etwldbs.mdb">
</span> 备份数据
库路径:<span style="background-color: #F7FFF7"><input type="text" name="backf" size="20" value="dbback/back.mdb"></span>
<span style="background-color: #F7FFF7">
<input type="submit" name="Submit" value="恢复" >
<input type="reset" name="Submit2" value="重置" > </span>
</td>
</tr>
</table>
</center>
</div>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -