Compact MDB database

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

Compact MDB database

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

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 149 votes

  • Category: ASP/Database Concepts

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

  • Submitted By: Devesh Khanna

  • Set as Favorite


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

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 37.58%  56
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.74%  16
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 12.08%  18
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.41%  17
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.19%  42

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.