Solved

Compacting an Access 2010 database without opening Access or programmably

Posted on 2013-12-30
2
445 Views
Last Modified: 2013-12-31
Hello All

I was wondering if it is possible to compact an Access 2010 database without opening Access (like putting the steps into a batch file) or creating a second Access program to do it automatically.

What I would need to have happen is:
1. Automatically each night (around midnight when everyone is off it) a copy of the Access database is made and the older copy (from the night before) is deleted.
2. The original is compacted and repaired.

All with no human interaction (I don't want to have to be up at midnight to answer msg boxes).

Any help is appreciated.
0
Comment
Question by:alevin16
2 Comments
 
LVL 12

Assisted Solution

by:pdebaets
pdebaets earned 100 total points
ID: 39747547
Our free Application Starter utility will do something similar. Rather than compact and backup at midnight, it will do this when the first user opens the application in the morning. http://peterssoftware.com/aps.htm
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 39747918
You can also run a batch file to do this:

@echo off
cd\ "full path to your backup folder"
del "full name of your backup file"
copy /y "full path to your database" "full path to your backup file"
cd\"full path to the office folder"
msaccess.exe "full path to your database" /compact

Save this as a Batch file (perhaps name it "CompactMyDB.bat"), and then run that as needed. You can schedule this to run through the Windows Scheduler if needed.

Be sure to use full paths to all files, including the name and extension of the file EXCEPT for the cd\ lines - those are "change directory" lines, and you only use the folder path for those.

See this for more information on Batch file commands:

http://www.robvanderwoude.com/batchcommands.php
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Supress Detail 4 19
How to calcualate lateness in Access 2010 11 27
Max per month 3 15
Access checkbox 2 0
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now