Topics Search

Compact And Repair Macro?

Compact And Repair Macro?
Views: 11
I am running a switchboard. One of the buttons on the switchboard is set for the exit Access database. Is there a way of setting this macro so that it performs a backup, then compacts and repairs, and then exits, or is this only a VBA thing.

If so, how and where would I write the VBA/macro to do what I'm looking to do from the switchboard.

The users do not have access to the regular database controls as I have changed the properties to .accdr, and I have disabled all other ways of exiting the program exceptthrough that one switchboard button (or task manager).

I am still pretty new to access, and actually enjoying it.
Sponsored Links:

More topics


Compact and Repair crashes on larger databases

When I try to run compact and repair on any database that is ~500MB or larger, Access crashes . It is pretty consistent on when it crashes. e.g. a DB that is 692MB crashes when the temp DB reaches 569MB.

Here is where it gets stranger. .problem happens on multiple databases and I can copy the DB to another computer with Access 2007 (Same version) and Compact/Repair works fine.

For problem / attempted corrections I have tried the following with no luck

Checkdsk - OK
Boot in Save Mode - Compact / Repair still crashes
Move DB to another HD on my computer (Thinking I may have disk failing) - Compact / Repair still crashes
Uninstall / Install Access - - Compact / Repair still crashes

Compact Repair BE

I've read quite a few posts on compact and repair but need some clarification.
I have a split database; how often should you compact the FE? How often should you compact the BE? I would like to run a batch file through task manager to trigger the back end compact late at night so no one can open it.
The back end has a security password set; when I do a command line compact repair in task manager it starts to work then stops at the password input box. How can I add this password to a batch file so it can complete the compact and repair. I see through the posts that you should back up the DB first. Can someone help me with the batch file to include a back up then compact the DB?

Data loss after compact & repair

I have just done a compact and repair on my Access database. Afterwards one of the tables has lost a lot of data (but only one?).

Spookily the table now has exactly 20000 records in it, which makes me think this is some kind of limit, except that I dont think there are table limits in Access and I have other tables in the database with more than this number of records that are still ok.

Is there any way of recovering the data after a compact & repair?

Any ideas why the compact repair would have deleted these records? (It hasnt happenned with previous compact repairs)

I dont have a recent backup of the database, but thats a different problem!

Compact and Repair Database

Is it possible to build a macro where you can compact and repair the database as one of the steps?

Compact and repair on close

I inherited a multi-user database that is on a network drive. There are multiple front ends for people to use and they are all set up to compact and repair when they close out of the program. The problem I have been having lately is there have been a lot of DB1.MDB that show up along with the front door of the program. Should I turn off the compact and repair or should I leave it on

Problem in MS Access data update

I have a database it contains data more than 4 million line items but while I try to run macro or any query the database reaches the maximum limit of 2 gb , then the particular query not functioning and then I need to compact and repair. After compact and repair also the same issue is continuing.

Kindly help me in solving this issue else tell me some other solution to eliminate this issue and resolve it.

Compact and Repair an Access Runtime Application

I'm building a Runtime app in Access 2007 that will be run by many people who are quite INexperienced with computers, and will have even less experience with Access. Is there a SAFE way tocompact and repair an Access 2007 Runtime program?

I keep seeing warnings about using the automatic compact and repair in the Access Options of 2007. However, I'm worried about data bloat if this is never done.

Does anyone out there have experience with Access 2007 Runtime using the automatic compact and repair?

Compact and repair failure

My database is failing to compact and repair. The error message is "invalid argument". Background: using access 2000, and the db is very very large, 2,096,444KB. I'm pretty sure there is some type of 2GB limit.. I've exported the huge table elsewhere, and am trying to compact..but it won't. Another caveat is that some of the tables are local like this one, others are on a sql server.

Compact and Repair Database

In MS Access 2003 I used this code to compact and repair my database,

Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database.."). _
End Sub

But for some reason this doesn't work in MS Access 2007. That might be because MS Access 2007 does not have a Menu Bar.

How would I write the code to manipulate the menus in 2007 to compact and repair the database. This is a stand alone database.

Compact and Repair a Database

This procedure compacts and repairs a database, creates a log if there is any corruption in the source file, and returns a Boolean value based on whether the recovery was successful. Learn how to compact and repair a database.