Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004

    Unanswered: Compacting an Access db file from Excel

    In Excel (XP or 2003, we use both), is there a relatively easy and dependable way to compact an Access database file? I didn't find the Excel VBA help file useful because it required creating a second, compacted file. (Is the only way to compact the existing file and keep it's name to do so from within Access??) A search here didn't turn up any results, either. (I tried searching only the Excel forum but kept getting results from the Access forum, etc.!)

    I simply want to save the user from having to open Access to compact a db file periodically used (data loaded into Array in Excel at startup then only sproratic db data updates) by the Excel file.

    Any ideas? Much appreciated.

  2. #2
    Join Date
    Jan 2002
    Bay Area
    I use the Compact on Close option to keep a data base healthy? You can set this up in the data base by clicking Tools/Options, and in the General tab, check the Compact on Close box. Then whenever the Access data base is used, it will be compacted when closed.
    For a single-user data base, this may be the simplest solution there is.


  3. #3
    Join Date
    Feb 2004
    You can create a shortcut file or batch file with the command line switch to compact the DB. Then activate teh command from Excel or click the compact shortcut to compact. Use this format.

    Place this path in a shortcut file.

    "<path to msaccess.exe>" "<path to your mdb>" /compact


    "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Projects\Analytic\Anal2000.mdb" /compact


  4. #4
    Join Date
    May 2004
    A belated thanks to you both for excellent ideas!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts