介绍一个用ASP来压缩ACCESS数据库的例子
类别: ASP教程
<%
oldDB = "d:netaccessTest.mdb"
bakDB = "d:netaccessTestBack.mdb"
newDB = "d:netaccessCompact.mdb"
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
\' back up database
FSO.CopyFile oldDB, bakDB , true
\' compact database
Set Engine = Server.CreateObject("JRO.JetEngine")
prov = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Engine.CompactDatabase prov & OldDB, prov & newDB
set Engine = nothing
\' delete original database
FSO.DeleteFile oldDB
\' Move (rename) compacted database
FSO.MoveFile newDB, oldDB
set FSO = nothing
%>
oldDB = "d:netaccessTest.mdb"
bakDB = "d:netaccessTestBack.mdb"
newDB = "d:netaccessCompact.mdb"
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
\' back up database
FSO.CopyFile oldDB, bakDB , true
\' compact database
Set Engine = Server.CreateObject("JRO.JetEngine")
prov = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Engine.CompactDatabase prov & OldDB, prov & newDB
set Engine = nothing
\' delete original database
FSO.DeleteFile oldDB
\' Move (rename) compacted database
FSO.MoveFile newDB, oldDB
set FSO = nothing
%>
- 上一篇: 在表单里使用
- 下一篇: 用ASP技术得到主页被访问次数的三种方法
-= 资 源 教 程 =-
文 章 搜 索