📄 admin_database.asp
字号:
</td>
</tr>
</form>
</table>
<%
Else
%>
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder" <tr>
<th height=25 >
恢复系统数据 ( 需要FSO支持,FSO相关帮助请看微软网站 )
</th>
</tr>
<form method="post" action="?action=RestoreData&act=Restore">
<tr>
<td height=100 class="TableRow1">
备份数据库路径(相对):<input type=text size=45 name=DBpath value="DataBackup\NewCloud_Backup.MDB"> <BR>
目标数据库路径(相对):<input type=text size=45 name=backpath value="<%=db%>"><BR> 填写您当前使用的数据库路径,如不想覆盖当前文件,可自行命名(注意路径是否正确),然后修改conn.asp文件,如果目标文件名和当前使用数据库名一致的话,不需修改conn.asp文件<BR>
<input type=submit value="恢复数据库" class=Button> <br>
-----------------------------------------------------------------------------------------<br>
在上面填写本程序的数据库路径全名,本程序的默认备份数据库文件为DataBackup\NewCloud_Backup.MDB,请按照您的备份文件自行修改。<br>
您可以用这个功能来备份您的法规数据,以保证您的数据安全!<br>
注意:所有路径都是相对与程序空间根目录的相对路径</font>
</td>
</tr>
</form>
</table>
<%
End If
End Sub
'====================备份数据库=========================
Sub BackupData()
If IsSqlDataBase = 1 Then
%>
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder">
<tr>
<th height=25 >
备份SQL数据
</th>
</tr>
<form method="post" action="?action=BackupData&act=Backup">
<tr>
<td height=100 class="TableRow1">
当前SQL数据库名称:<input type=text size=25 name=SqlDataName value="<%=SqlDatabaseName%>"><BR>
SQL数据库用户名称:<input type=text size=25 name=SqlUserID value="<%=SqlUsername%>"> 请输入您的SQL数据库用户名<BR>
SQL数据库用户密码:<input type=Password size=25 name=SqlUserPass value="<%=SqlPassword%>"> 请输入您的SQL数据库连接密码<BR>
SQL数据库服务器名:<input type=text size=25 name=SqlServer value="<%=SqlLocalName%>"> 连接服务器名(本地用local,外地用IP)<BR>
备份SQL数据库目录:<input type=text size=25 name=BackupSqlDir value="Databackup"> 如目录不存在,程序将自动创建<BR>
备份SQL数据库名称:<input type=text size=25 name=BackupSqlName value="$1.bak"> 如使用默认的($1)备份名,系统将自动按日期时间创建备份名称<BR>
<input type=submit value="备份数据库" class=Button><br>
-----------------------------------------------------------------------------------------<br>
您可以用这个功能来备份您的法规数据,以保证您的数据安全!<br>
注意:所有路径都是相对与程序空间管理目录的相对路径 </font>
</td>
</tr>
</form>
</table>
<%
Else
%>
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder">
<tr>
<th height=25 >
备份系统数据 ( 需要FSO支持,FSO相关帮助请看微软网站 )
</th>
</tr>
<form method="post" action="?action=BackupData&act=Backup">
<tr>
<td height=100 class="TableRow1">
当前数据库路径(相对路径):<input type=text size=45 name=DBpath size=45 value="<%=db%>"><BR>
备份数据库目录(相对路径):<input type=text size=20 name=bkfolder size=45 value=Databackup> 如目录不存在,程序将自动创建<BR>
备份数据库名称(填写名称):<input type=text size=20 name=bkDBname size=45 value=NewCloud_Backup.MDB> 如备份目录有该文件,将覆盖,如没有,将自动创建<BR>
<input type=submit value="备份数据库" class=Button><br>
-----------------------------------------------------------------------------------------<br>
在上面填写本程序的数据库路径全名,本程序的默认数据库文件为<%=db%>,<B>请一定不能用默认名称命名备份数据库</B><br>
您可以用这个功能来备份您的法规数据,以保证您的数据安全!<br>
注意:所有路径都是相对与程序空间管理目录的相对路径 </font>
</td>
</tr>
</form>
</table>
<%
End If
End Sub
Sub BackupDatabase()
Dbpath = request.Form("Dbpath")
If InStr(Dbpath, ":") = 0 Then
Dbpath = Server.MapPath(Dbpath)
Else
Dbpath = Dbpath
End If
bkfolder = request.Form("bkfolder")
bkdbname = request.Form("bkdbname")
Set Fso = server.CreateObject("scripting.filesystemobject")
If fso.FileExists(dbpath) Then
If CheckDir(bkfolder) = True Then
fso.CopyFile dbpath, bkfolder& "\"& bkdbname
Else
MakeNewsDir bkfolder
fso.CopyFile dbpath, bkfolder& "\"& bkdbname
End If
Succeed("备份数据库成功,您备份的数据库路径为" &bkfolder& "\"& bkdbname)
Else
FoundErr = True
ErrMsg = "找不到您所需要备份的文件。"
Exit Sub
End If
End Sub
Sub RestoreDatabase()
Dim backpath,Dbpath
Dbpath = request.Form("Dbpath")
backpath = request.Form("backpath")
If dbpath = "" Then
FoundErr = True
ErrMsg = "请输入您要恢复成的数据库全名"
Exit Sub
End If
If InStr(Dbpath, ":") = 0 Then
Dbpath = Server.MapPath(Dbpath)
Else
Dbpath = Dbpath
End If
If InStr(backpath, ":") = 0 Then
backpath = Server.MapPath(backpath)
Else
backpath = backpath
End If
Set Fso = server.CreateObject("scripting.filesystemobject")
If fso.FileExists(dbpath) Then
fso.CopyFile Dbpath, Backpath
Succeed("成功恢复数据!")
Else
FoundErr = True
ErrMsg = "备份目录下并无您的备份文件!"
Exit Sub
End If
End Sub
'------------------检查某一目录是否存在-------------------
Function CheckDir(FolderPath)
folderpath = Server.MapPath(".")&"\"&folderpath
Set fso1 = CreateObject("Scripting.FileSystemObject")
If fso1.FolderExists(FolderPath) Then
'存在
CheckDir = True
Else
'不存在
CheckDir = False
End If
Set fso1 = Nothing
End Function
'-------------根据指定名称生成目录-----------------------
Function MakeNewsDir(foldername)
Dim f
Set fso1 = CreateObject("Scripting.FileSystemObject")
Set f = fso1.CreateFolder(foldername)
MakeNewsDir = True
Set fso1 = Nothing
End Function
'====================压缩数据库 =========================
Sub CompressData()
If IsSqlDataBase = 1 Then
SQLUserReadme()
Exit Sub
End If
%>
<table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder">
<tr>
<th height=25 >
压缩数据库 ( 需要FSO支持,FSO相关帮助请看微软网站 )
</th>
<form action="?action=CompressData&act=Compress" method="post">
<tr>
<td class="TableRow1" height=25><b>注意:</b><br>输入数据库所在相对路径,并且输入数据库名称(正在使用中数据库不能压缩,请选择备份数据库进行压缩操作) </td>
</tr>
<tr>
<td class="TableRow1">压缩数据库:<input type="text" name="dbpath" size=45 value=<%=db%>>
<input type="submit" value="开始压缩" class=Button></td>
</tr>
<tr>
<td class="TableRow1"><input type="checkbox" name="boolIs97" value="True">如果使用 Access 97 数据库请选择
(默认为 Access 2000 数据库)<br><br></td>
</tr>
<form>
</table>
<%
End Sub
Sub CompressDatabase()
Dim dbpath, boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
If InStr(Dbpath, ":") = 0 Then
Dbpath = Server.MapPath(Dbpath)
Else
Dbpath = Dbpath
End If
Response.Write(CompactDB(dbpath, boolIs97))
Else
FoundErr = True
ErrMsg = "请输入要压缩的数据库路径!"
Exit Sub
End If
End Sub
'=====================压缩参数=========================
Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath, JET_3X
strDBPath = Left(dbPath, instrrev(DBPath, "\"))
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(dbPath) Then
fso.CopyFile dbpath, strDBPath & "temp.mdb"
Set Engine = CreateObject("JRO.JetEngine")
If boolIs97 = "True" Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -