[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Compacting an Access 2010 database without opening Access or programmably

Posted on 2013-12-30
2
Medium Priority
?
462 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Assisted Solution

by:pdebaets
pdebaets earned 400 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1600 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

656 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