The following code can be used to compact MS Access(MDB) database using ASP code. Compacting the database is requuired to reduce the growing MDB file size. This can be achieved by using DAO or JRO:
Using DAO:Requirements: DAO engine (DAO 3.5 must be installed)
Set Engine = CreateObject("DAO.DBEngine.35")
Engine.CompactDatabase "dbpath\database.mdb", "dbpath\compact_database.mdb"
Using JRO:Requirements: JRO (At least MDAC 2.1 must be installed)
Set Engine = CreateObject("JRO.JetEngine")
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path\database.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path\compacted_database.mdb"
Using DAO or JRO you can only create a new copy of the compacted database and then copy the new db file/rename it to the new one. Compacting the MDB directly is not possible.