<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="73" align="center" valign="top" bgcolor="#A0CCD8"><!--#include file="adminleft.asp"--></td>
    <td width="920" align="center" valign="top">
	<table width="100%" height="0"  border="0" cellpadding="5" cellspacing="0">
      <tr>
        <td height="24" background="image/usercenter_3.jpg">           <div align="center"><font color="#FFFFFF"><strong>备 份 数 据 库</strong> </font> </div></td>
      </tr>
    </table>
	<strong>      </strong>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="25">
<div align="center"></div>
<%
if request("action")="Backup" then
call backupdata()
else
%></td>
        </tr>
        <tr> 
          <form method="post" action="Manage_backup.asp?action=Backup">
		    <td>
              <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1">
                <tr> 
                  <td height="22">数据库源：</td>
                </tr>
                <tr> 
                  <td height="22"><input type="txet" size="30" name="bkDBname" value="../data/myweb.mdb" disabled></td>
                </tr>
				<tr> 
                  <td height="22">备份数据库名称</td>
                </tr>
                <tr> 
                  <td height="22"><input type="txet" size="30" name="bkDBname" value="backdata.mdb" disabled></td>
                </tr>
                <tr> 
                  <td height="22"><div align="center">
                      <input type=submit value="== 确认备份 ==">
                  </div></td>
                </tr>
                <tr> 
                  <td height="22"><br>
                    <br>
                    本程序的默认数据库文件为<%=db%><br>
                    您可以用这个功能来备份您的法规数据，以保证您的数据安全！<br>
                  注意：所有路径都是相对与程序空间根目录的相对路径</td>
                </tr>
                <tr> 
                  <td height="22">&nbsp;</td>
                </tr>
              </table></td>
          </form>
        </tr>
      </table>
      <%end if%><% 
sub backupdata() 
Dbpath="../#einfodata/#einfo$webdata.mdb" 
Dbpath=server.mappath(Dbpath) 
bkfolder="../mydatabackup"
bkdbname="#ews"&date()&"-"&session("ewsname")&"-Joh.mdb"
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 "<font color=red>备份数据库成功!</font>" 
'response.write "备份数据库成功，您备份的数据库路径为" &bkfolder& "\"& bkdbname 
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 
%></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->