您现在的位置是:网站首页> 编程资料编程资料
asp Access数据备份,还原,压缩类代码_数据库相关_
2023-05-25
379人已围观
简介 asp Access数据备份,还原,压缩类代码_数据库相关_
<%
'数据库管理类
class Datas
'备份
public sub Bk()
Set fso=server.createobject("scripting.filesystemobject")
fso.CopyFile Server.MapPath(SiteDataPath),Server.MapPath(SiteDataBakPath)
set fso=nothing
response.Write("")
end sub
'还原
public sub Rt()
SDPath = server.mappath(SiteDataPath)
SDBPath = server.mappath(SiteDataBakPath)
set Fso=Server.CreateObject("Scripting.FileSystemObject")
if Fso.FileExists(SDBPath) then
Fso.CopyFile SDBPath,SDPath
Set Fso=nothing
response.Write("")
else
response.Write("")
end if
end sub
'压缩
public sub Dc()
SDBPath = server.mappath(SiteDataBakPath)
set Fso=Server.CreateObject("Scripting.FileSystemObject")
if Fso.FileExists(SDBPath) then
Set Engine =Server.CreateObject("JRO.JetEngine")
if request("boolIs") = "97" then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb"
end if
Fso.CopyFile SDBPath & "_temp.mdb",SDBPath
Fso.DeleteFile(SDBPath & "_temp.mdb")
set Fso = nothing
set Engine = nothing
response.Write("")
else
response.Write("")
end if
end sub
end class
%>
相关内容
- ASP+FSO生成的网页文件默认编码格式以及转换成UTF-8编码方法_应用技巧_
- ASP UTF-8编码生成静态网页的函数_应用技巧_
- ASP 常见对象总结(熟悉一下利用以后的开发使用)_应用技巧_
- asp最简单的生成验证码代码_应用技巧_
- asp实现新评论自动发短信提示的代码_应用技巧_
- asp将table生成excel文件(xls)_应用技巧_
- 防盗链接ASP函数_小偷/采集_
- asp 小偷采集程序原理与常用函数方法_小偷/采集_
- 有效防止ASP木马上传运行—小知识[网络安全技术]_木马相关_
- set rs=server.CreateObject("adodb.recordset") 的中文详细说明_数据库相关_
