Compact and Repair database

T

TS Lim

I'm writing a program for my user to do the repair and compact of the backend.

I found two vba comands from the help file:
1. expression.CompactRepair(SourceFile, DestinationFile, LogFile)
2. expression.CompactDatabase(SrcName, DstName, DstLocale, Options, password)

It seem that I can only use No 2. because my backend is password protected.
My quesiton is: is command No 2 doing only compact and not repair, or it
perform the same as No 1, doing both compact and repair.

Thank you.
 
D

Daniel Pineault

You have the basic idea, but there is a great deal more to know to be able to
perform a compact and repair of the back-end from your front-end. For
instance, you first have to ensure exclusive connection to the db (no one
else can be in it at the time). Anyways, your best best is to look at
existing examples rather start to reinvent the wheel. If you google 'vba
compact and repair back-end' you'll find tons of information and examples.
Also, below are two that I found, the 1st of which is from a very good source
(I would tend to start there).

http://www.rogersaccesslibrary.com/forum/topic378.htm
http://bytes.com/topic/access/answers/208170-how-compact-repair-back-end-front-end
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
L

Linq Adams via AccessMonster.com

Also be aware that there is a great deal of anecdotal evidence found both
here and on a number of Access forums that paradoxically points towards
Compacting as being a cause of corruption! It's probably a good idea to
backup your file before Compacting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top