Compact MDB database

Tutorials Shared by the Internet Community

Advertisements


Compact MDB database

Two ways to compact (compress) MDB database directly from the ASP/VBS using DAO 3.5 or JRO (MDAC 2.1).

Statistics

  • Total Hits - 32938

  • Total Votes - 100 votes

  • Vote Up - 43 votes

  • Vote Down - 57 votes

  • Domain - www.motobit.com

  • Category - ASP/Database Concepts

  • Submitted By - Devesh Khanna

  • Submitted on - 2008-03-06 09:35:56

Description

You can compact MDB database directly from the ASP (VBS) by DAO or JRO :

1. DAO engine (DAO 3.5 must be installed)

Set Engine = CreateObject("DAO.DBEngine.35")
Engine.CompactDatabase "path\database.mdb", "path\compacted_database.mdb"

2. 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"


Either DAO or JRO does not support compact to the same file name. You must create temporary compacted database and then copy the temporary file over original database.    More detail...


Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements