分享你我的心得.
共乘一片美好网络.

自动备份Access数据库

<meta http-equiv="refresh" content="10800;href=show_info.asp">
<%
‘备份数据库,最多只能存放24个数据库,三小时备份一次,正常保存三天内的数据
‘Writer Chinajavaer http://sgh.3zha.com
Dim FolderPath,Fso,I
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
For i = 1 to 25
   If Not Fso.FolderExists(Server.MapPath("Back/" & I)) Then
      Call Fso.CreateFolder(Server.MapPath("Back/" & I))
   End If
Next
Call Fso.DeleteFolder(Server.MapPath("Back/1"))
For I = 2 to 25
    Call Fso.CopyFolder(Server.MapPath("Back/"&I),Server.MapPath("Back/"&(I-1)))
 Call Fso.DeleteFolder(Server.MapPath("Back/" & I))
Next
FolderPath = Server.MapPath("Back/24/" & year(now()) & month(now()) & day(now()) & hour(now()) & minute(now()) & second(now()))
Call Fso.CreateFolder(FolderPath)
call Fso.CopyFile(Server.MapPath("../date/xxxxxxx.mdb"),FolderPath& "\")
Set FolderPath = Nothing
Set Fso = Nothing
Set I = Nothing
%>
 
赞(0)
未经允许不得转载:小叶白龙博客 » 自动备份Access数据库
分享到: 更多 (0)

评论 5197

评论前必须登录!