<%
oldDB = "d:
etaccessTest.mdb"
bakDB = "d:
etaccessTestBack.mdb"
newDB = "d:
etaccessCompact.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
%>