当前位置:Gxlcms > 数据库问题 > 数据库压缩

数据库压缩

时间:2021-07-01 10:21:17 帮助过:2人阅读

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

数据库压缩

标签:

人气教程排行