?? backup.asp
字號:
<!--#include file="chk.asp"-->
<html><head><title>數據備份</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet type=text/css>
</head>
<body>
<!--#include file="TopManu.asp"-->
<%
dim bkfolder
dim bkdbname
dim fso
dim folderpath,fso1,f
call main()
sub main()
%>
<%
if request("action")="Backup" then
call backupdata()
else
%>
<div align="center">
<table border="0" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td background="image/admintoptdbg.gif">
<p align="left">
<img border="0" src="image/title_arrow.bmp" width="17" height="27" align="absmiddle"><font color="#808080"><b>備份數據庫</b></font></td>
</tr>
</table>
<table class="tableBorder" width="100%" border="1" cellpadding="4" cellspacing="0" style="border:1px solid #C0C0C0; border-collapse: collapse; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" bordercolor="#CCCCCC">
<tr>
<td width="100%" bgcolor="#F7F7F7">
<font color="#FF0000">注意:注意:備份數據需要FSO組件支持,FSO組件的相關幫助!所有路徑都是相對與程序空間根目錄的相對路徑!此功能謹慎使用,可能在有些空間備份后,在本機上不能用ACCESS打開。</font></td>
</tr>
<tr><form method="post" action="Backup.asp?action=Backup">
<td width="100%" bgcolor="#F7F7F7">
當前數據庫路徑:<input type=text size=24 name=DBpath value="../byfenglan#/byfenglanAC.mdb">
請正確添寫您當前使用的數據庫路徑!<BR>
備份數據庫目錄:<input type=text size=24 name=bkfolder value=../jj_Databackup>
如果目錄不存在,程序將自動創建!<BR>
備份數據庫名稱:<input type=text size=24 name=bkDBname value=byec_shop.mdb>
如果備份目錄有該文件,將覆蓋,如果沒有,程序將自動創建!<br>
<input type=submit value="開始備份"></td>
</tr>
<tr>
<td width="100%" bgcolor="#F7F7F7">
在上面填寫數據庫路徑及數據庫完整名稱,程序的默認數據庫文件為byec_shop.mdb<br>
您可以用這個功能來備份您的數據庫,以保證數據的安全!<br></td>
</tr></form>
</table>
</div>
<table border="0" width="760" id="table3" cellspacing="0" cellpadding="0" align=center>
<tr>
<td align=right><input TYPE="button" VALUE="刷新本頁" ONCLICK="location.reload()"> </td>
</tr>
</table>
<%
end if
%>
<%
end sub
sub backupdata()
Dbpath=request.form("Dbpath")
Dbpath=server.mappath(Dbpath)
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
response.write "數據庫備份完成,請進行其他操作!<br>建立使用 FTP 工具將數據庫備份,以保證數據安全"
else
response.write "找不到您所需要備份的文件!"
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)
Set fso1 = CreateObject("Scripting.FileSystemObject")
Set f = fso1.CreateFolder(foldername)
MakeNewsDir = True
Set fso1 = nothing
End Function
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -