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

📄 admin_database.asp

📁 前台完全分离了HTML与ASP
💻 ASP
字号:
<%
  Function CompactDatabase()
   Set Conn=Nothing
   Dim FSO,Engine
   Set FSO=Server.CreateObject("Scripting.FileSystemObject")
   IF FSO.FileExists(Server.Mappath("../"&ZD_DataName)) Then
       ' Response.Write "<div id=""Layer1"" style=""position:absolute; left:220px; top:153px; width:372px; height:95px; z-index:1"" class=""tdbg3""></div>"
       ' Response.Write "<div id=""Layer2"" style=""position:absolute; left:222px; top:155px; width:371px; height:93px; z-index:1; overflow: hidden;"" class=""tdbg1"">数据库压缩中....请等待....</div>"
		Set Engine = CreateObject("JRO.JetEngine")
		Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../" & ZD_DataName), "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../" & ZD_DataName & ".temp")
		FSO.CopyFile Server.Mappath("../" & ZD_DataName & ".temp"),Server.Mappath("../"&ZD_DataName)
		FSO.DeleteFile(Server.Mappath("../" & ZD_DataName & ".temp"))
		Set FSO = Nothing
		Set Engine = nothing
		CompactDatabase = "<span class=""importantText"">压缩数据库成功!!</span>"
		call SaveLog(Session("member"),"成功操作",now(),"数据库压缩",getIP(),true)
   End If
  End Function
  
  Function BackupDatabase()
   Set Conn=Nothing
   Set FSO=Server.CreateObject("Scripting.FileSystemObject")
   FSO.CopyFile Server.Mappath("../" & ZD_DataName),Server.Mappath("../" & ZD_DataName & ".bak")
   Set FSO = Nothing
   BackupDatabase = "<span class=""importantText"">数据库备份成功!!</span>"
   call SaveLog(Session("member"),"操作成功",now(),"数据库备份",getIP(),true)
  End Function
  
  Function RestoreDatabase()
   Application.Contents.Removeall()
   Set Conn=Nothing
   Set FSO=Server.CreateObject("Scripting.FileSystemObject")
   IF FSO.FileExists(Server.Mappath("../" & ZD_DataName & ".bak")) Then
    FSO.CopyFile Server.Mappath("../" & ZD_DataName & ".bak"),Server.Mappath("../" & ZD_DataName)
	Set FSO = Nothing
    RestoreDatabase = "<span class=""importantText"">数据库恢复成功!!</span>"
    call SaveLog(Session("member"),"操作成功",now(),"数据库恢复",getIP(),true)
   Else
    Set FSO = Nothing
    RestoreDatabase = "<span class=""importantText"">不存在有备份文件!</span>"
    call SaveLog(Session("member"),"操作失败",now(),"数据库恢复",getIP(),false)
   End IF
  End Function
%>

⌨️ 快捷键说明

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