If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Compacting an Access db file from Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-07, 08:23
paulzak paulzak is offline
Registered User
 
Join Date: May 2004
Posts: 54
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.
Reply With Quote
  #2 (permalink)  
Old 03-22-07, 15:44
JerryDal JerryDal is offline
Registered User
 
Join Date: Jan 2002
Location: Bay Area
Posts: 473
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.

Jerry
Reply With Quote
  #3 (permalink)  
Old 03-22-07, 21:28
savbill savbill is offline
Registered User
 
Join Date: Feb 2004
Posts: 533
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

Example:

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

Bill
Reply With Quote
  #4 (permalink)  
Old 05-16-07, 16:03
paulzak paulzak is offline
Registered User
 
Join Date: May 2004
Posts: 54
A belated thanks to you both for excellent ideas!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On