首页 > 数据库技术 > 详细

数据库压缩

时间:2016-07-20 13:24:37      阅读:179      评论:0      收藏:0      [点我收藏+]

dim Engine,connpath,dbPath,strDBPath,fso
Set Engine = CreateObject("JRO.JetEngine") 

connpath="#jobs.asp"‘与数据库在同一目录下,并没有临时文件temp.mdb
dbPath=server.MapPath(connpath)
strDBPath = left(DBPath,instrrev(DBPath,"\")) 
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath, _ 
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb" 
Set Engine = nothing 

dbPath=server.MapPath(connpath)
strDBPath = left(DBPath,instrrev(DBPath,"\")) 

Set fso = CreateObject("Scripting.FileSystemObject") 
on error resume next
fso.CopyFile strDBPath & "temp.mdb",dbpath 
if err<>0 then coperr=true
fso.DeleteFile(strDBPath & "temp.mdb") 
if err<>0 then delerr=true
Set fso = nothing

数据库压缩

原文:http://www.cnblogs.com/lykouyi/p/5687852.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!