Solved

Compacting an Access 2010 database without opening Access or programmably

Posted on 2013-12-30
2
459 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 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

732 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