⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 empmain_data.asp

📁 好用的管理,代码程序 好用的管理,代码程序
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/EmpMain.asp" -->
<!--#include file="EmpMain_CheckRight.asp"-->
<%
if fncheckupart(1)=true or fncheckupart(2)=true then
else
	response.Write("没有权限访问该页!")
	response.end
end if
%>
<link rel="stylesheet" href="CSS/SellWellWeb.css" type="text/css">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top">
     <table width="52%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <tr> 
          <td  class="CaptionS" height="25"> 备份数据库
            <%
				if request("action")="Backup" then
				call backupdata()
				else
			%>
		</td>
        </tr>
        <tr class="Caption"> 
          <form method="post" action="EmpMain_data.asp?action=Backup">
            <td><br> 
              <table width="87%" border="0" align="center" cellpadding="0" cellspacing="2">
                <tr> 
                  <td height="25" class="CaptionS">备份数据库文件[需要FSO权限]</td>
                </tr>
                <tr> 
                  <td height="22" class="CaptionS"> 当前数据库路径</td>
                </tr>
                <tr> 
                  <td height="22" class="CaptionS"><input type=text size=20 name=DBpath value="<%=db_crm%>"></td>
                </tr>
                <tr> 
                  <td height="22"><input type="hidden" size=20 name=bkfolder value=Databackup ></td>
                </tr>
                <tr> 
                  <td height="22" class="CaptionS">备份数据库名称[如备份目录有该文件,将覆盖,如没有,将自动创建]</td>
                </tr>
                <tr> 
                  <td height="22" class="CaptionS"><input type=text size=28 name=bkDBname value="<%=date()%>"></td>
                </tr>
                <tr> 
                  <td height="22" class="CaptionS"> 
                      <input type=submit value="确定">
                    </div></td>
                </tr>
              </table></td>
          </form>
        </tr>
      </table>
      <%end if%>
<% 
	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 & ".mdb" 
			else 
				MakeNewsDir bkfolder 
				fso.copyfile dbpath,bkfolder& "\"& bkdbname & ".mdb"
			end if 
				response.write "<center>备份数据库成功,备份的数据库为 " & bkfolder & "\" & bkdbname & ".mdb</center>" 
				response.write"下载地址:http://www.feleke.com/crm/Databackup/"& bkdbname &".mdb"
		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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -