📄 admin_database.asp
字号:
<!--#include file="inc/inc_sys.asp"-->
<%
dim Action,FoundErr,ErrMsg
Action=trim(request("Action"))
dim dbpath
dim ObjInstalled
if not IsObject(conn) then link_database
if is_sqldata=0 then 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="images/admin/Admin_STYLE.CSS">
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<br>
<table width="98%" 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="admin_database.asp?Action=Backup">备份数据库</a> | <a href="admin_database.asp?Action=Restore">恢复数据库</a>
| <a href="admin_database.asp?Action=Compact">压缩数据库</a> | <a href="admin_database.asp?Action=SpaceSize">系统空间占用情况</a></td>
</tr>
</table>
<%
if Action="Backup" or Action="BackupData" then
if isobject(conn) then conn.close:set conn=nothing
call ShowBackup()
elseif Action="Compact" or Action="CompactData" then
if isobject(conn) then conn.close:set conn=nothing
call ShowCompact()
elseif Action="Restore" or Action="RestoreData" then
if isobject(conn) then conn.close:set conn=nothing
call ShowRestore()
elseif Action="SpaceSize" then
call SpaceSize()
if isobject(conn) then conn.close:set conn=nothing
else
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误参数!</li>"
if isobject(conn) then conn.close:set conn=nothing
end if
if FoundErr=True then
call WriteErrMsg()
end if
sub ShowBackup()
if is_sqldata=1 then sqldata_readme
%>
<form method="post" action="admin_database.asp?action=BackupData">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr class="title">
<td align="center" height="22" valign="middle"><span class="style1">备 份 数 据 库</span></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()
if is_sqldata=1 then sqldata_readme
%>
<form method="post" action="admin_database.asp?action=CompactData">
<table class="border" width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td align="center" height="22" valign="middle"><span class="style1">数据库在线压缩</span></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="submit2" 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()
if is_sqldata=1 then sqldata_readme
%>
<form method="post" action="admin_database.asp?action=RestoreData">
<table width="98%" class="border" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td align="center" height="22" valign="middle"><span class="style1">数据库恢复</span></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\oblog.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 SpaceSize()
on error resume next
dim rs
set rs=oblog.execute("select userdir from oblog_userdir")
%>
<br>
<table class="border" width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td align="center" height="22" valign="middle"><span class="style1">系统空间占用情况</span></td>
</tr>
<tr class="tdbg">
<td width="100%" height="150" valign="middle">
<blockquote><br>
系统数据占用空间:
<%showSpaceinfo("data")%>
<br>
<br>
备份数据占用空间:
<%showSpaceinfo("databackup")%>
<br>
<br>
程序文件占用空间:
<%showSpecialSpaceinfo("Program")%>
<br>
<br>
配色模板占用空间:
<%showSpaceinfo("skin")%>
<br>
<br>
系统图片占用空间:
<%showSpaceinfo("images")%>
<%while not rs.eof %>
<br>
<br>
<%=rs(0)%>目录占用空间:
<%showSpaceinfo(rs(0))%>
<%rs.movenext
wend%>
<br>
<br>
系统占用空间总计:
<%showspecialspaceinfo("All")%>
</blockquote>
</td>
</tr>
</table>
<br>
<%
end sub
sub sqldata_readme
%>
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="98%" class="border"> <tr>
<th height=25> <font color="#FFFFFF"> SQL数据库数据处理说明</font> </th>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -