📄 ad_database.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=1
Const CheckChannelID=0
Const PurviewLevel_Others="Database"
'response.write "此功能被暂时禁止了!"
'response.end
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/func.asp"-->
<%
dim Action,FoundErr,ErrMsg
Action=trim(request("Action"))
dim dbpath
dim ObjInstalled
dbpath=server.mappath(db)
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
%>
<html>
<head>
<title>数据库备份</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="ad_Style.css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>数 据 库 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="ad_Database.asp?Action=Backup">备份数据库</a> | <a href="ad_Database.asp?Action=Restore">恢复数据库</a>
| <a href="ad_Database.asp?Action=Compact">压缩数据库</a> | <a href="ad_Database.asp?Action=Init">系统初始化</a>
| <a href="ad_Database.asp?Action=SpaceSize">系统空间占用情况</a></td>
</tr>
</table>
<%
if Action="Backup" or Action="BackupData" then
call CloseConn()
call ShowBackup()
elseif Action="Compact" or Action="CompactData" then
call CloseConn()
call ShowCompact()
elseif Action="Restore" or Action="RestoreData" then
call CloseConn()
call ShowRestore()
elseif Action="Init" or Action="Clear" then
call ShowInit()
call CloseConn()
elseif Action="SpaceSize" then
call SpaceSize()
call CloseConn()
else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误参数!</li>"
call CloseConn()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn_User()
sub ShowBackup()
%>
<form method="post" action="ad_Database.asp?action=BackupData">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr class="title">
<td align="center" height="22" valign="middle"><b>备 份 数 据 库</b></td>
</tr>
<tr class="tdbg">
<td height="150" align="center" valign="middle">
<%
if request("action")="BackupData" then
call backupdata()
else
%>
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr>
<td width="200" height="33" align="right">备份目录:</td>
<td><input type=text size=20 name=bkfolder value=Databackup></td>
<td>相对路径目录,如目录不存在,将自动创建</td>
</tr>
<tr>
<td width="200" height="34" align="right">备份名称:</td>
<td height="34"><input type=text size=20 name=bkDBname value="<%=date()%>"></td>
<td height="34">不用输入文件名后缀(默认为“.asa”)。如有同名文件,将覆盖</td>
</tr>
<tr align="center">
<td height="40" colspan="3"><input name="submit" type=submit value=" 开始备份 " <%If ObjInstalled=false Then response.Write "disabled"%>></td>
</tr>
</table>
<%
If ObjInstalled=false Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if
end if
%>
</td>
</tr>
</table>
</form>
<%
end sub
sub ShowCompact()
%>
<form method="post" action="ad_Database.asp?action=CompactData">
<table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td align="center" height="22" valign="middle"><b>数据库在线压缩</b></td>
</tr>
<tr class="tdbg">
<td align="center" height="150" valign="middle">
<%
if request("action")="CompactData" then
call CompactData()
else
%>
<br>
<br>
<br>
压缩前,建议先备份数据库,以免发生意外错误。 <br>
<br>
<br>
<input name="submit" type=submit value=" 压缩数据库 " <%If ObjInstalled=false Then response.Write "disabled"%>>
<br>
<br>
<%
If ObjInstalled=false Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if
end if
%>
</td>
</tr>
</table>
</form>
<%
end sub
sub ShowRestore()
%>
<form method="post" action="ad_Database.asp?action=RestoreData">
<table width="100%" class="border" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td align="center" height="22" valign="middle"><b>数据库恢复</b></td>
</tr>
<tr class="tdbg">
<td align="center" height="150" valign="middle">
<%
if request("action")="RestoreData" then
call RestoreData()
else
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" height="30" align="right">备份数据库路径(相对):</td>
<td height="30"><input name=backpath type=text id="backpath" value="DataBackup\dxzmWeb.mdb" size=50 maxlength="200"></td>
</tr>
<tr align="center">
<td height="40" colspan="2"><input name="submit" type=submit value=" 恢复数据 " <%If ObjInstalled=false Then response.Write "disabled"%>></td>
</tr>
</table>
<%
If ObjInstalled=false Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
end if
end if
%>
</td>
</tr>
</table>
</form>
<%
end sub
sub ShowInit()
%>
<form action="ad_Database.asp" method="post" name="form1" id="form1" onSubmit="return confirm('确实要清除选定的表吗?一旦清除将无法恢复!');">
<table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td align="center" height="22" valign="middle"><b>系 统 初 始 化</b></td>
</tr>
<tr class="tdbg">
<td width="100%" height="150" align=center valign="middle">
<%
if Action="Clear" then
call ClearData()
else
%> <b><br>
<font color="#FF0000">请慎用此功能,因为一旦清除将无法恢复!</font><br>
<br>
</b>
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td align="center"><b>请选择你要清空的数据库:</b></td>
</tr>
<tr>
<td><fieldset><legend>文章频道</legend>
<table width="500" border="0" cellpadding="0" cellspacing="5">
<tr>
<td width="25%"><input name="ArticleClass" type="checkbox" id="ArticleClass" value="yes"> 文章栏目</td>
<td width="25%"><input name="Article" type="checkbox" id="Ariticle" value="yes"> 所有文章</td>
<td width="25%"><input name="Special" type="checkbox" id="Special" value="yes"> 文章专题 </td>
<td width="25%"><input name="ArticleComment" type="checkbox" id="ArticleComment" value="yes"> 文章评论</td>
</tr>
</table></fieldset></td>
</tr>
<tr>
<td><fieldset><legend>下载频道</legend><table width="500" border="0" cellpadding="0" cellspacing="5">
<tr>
<td width="25%"><input name="SoftClass" type="checkbox" id="SoftClass" value="yes"> 软件栏目</td>
<td width="25%"><input name="Soft" type="checkbox" id="Soft" value="yes"> 所有软件</td>
<td width="25%"><input name="SoftComment" type="checkbox" id="SoftComment" value="yes"> 软件评论</td>
<td width="25%"> </td>
</tr>
</table></fieldset></td>
</tr>
<tr>
<td><fieldset><legend>图片频道</legend><table width="500" border="0" cellpadding="0" cellspacing="5">
<tr>
<td width="25%"><input name="PhotoClass" type="checkbox" id="PhotoClass" value="yes"> 图片栏目</td>
<td width="25%"><input name="Photo" type="checkbox" id="Photo" value="yes"> 所有图片</td>
<td width="25%"><input name="PhotoComment" type="checkbox" id="PhotoComment" value="yes"> 图片评论</td>
<td width="25%"> </td>
</tr>
</table></fieldset></td>
</tr>
<tr>
<td><fieldset><legend>留言板</legend><table width="500" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="25%"><input name="Guest" type="checkbox" id="Guest" value="yes">
所有留言</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
</table>
</fieldset></td>
</tr>
<tr>
<td><fieldset><legend>其他</legend><table width="500" border="0" cellpadding="0" cellspacing="5">
<tr>
<td width="25%"> <input name="Announce" type="checkbox" id="Announce" value="yes">
公 告</td>
<td width="25%"><input name="Advertisement" type="checkbox" id="Advertisement" value="yes">
广 告</td>
<td width="25%"> <input name="Vote" type="checkbox" id="Vote" value="yes">
网站调查</td>
<td width="25%"><input name="FriendSite" type="checkbox" id="FriendSite" value="yes">
友情链接</td>
</tr>
<tr>
<td width="25%"> <input name="User" type="checkbox" id="User" value="yes">
注册用户</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
</table></fieldset></td>
</tr>
<tr>
<td align="center"><input name="Action" type="hidden" id="Action2" value="Clear">
<input type="submit" name="Submit" value="清除数据"></td>
</tr>
</table>
<%
end if
%>
</td>
</tr>
</table>
</form>
<%
end sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -