Re: Compact/Repair
- From: "Rick Brandt" <rickbrandt2@xxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 11:55:08 GMT
SheldonMopes@xxxxxxxxxx wrote:
> Here is my situation:I have several Access database projects that all
> keep their back-end data in a directory on a server. I would like to
> have a small Access application that could open each .mdb file, then
> compact and repair it, with no user intervention other than launching
> the application. Thank you for any help.
When compacting in code you can't compact a file onto itself so you also have to
include some renaming statements.
dbEngine.CompactDatabase "PathToFirstDatabaseSource"
"PathToFirstDatabaseDestination"
If Dir("PathToFirstDatabaseDestination") <> "" Then
Kill "PathToFirstDatabaseSource"
Name "PathToFirstDatabaseDestination" As "PathToFirstDatabaseSource"
End If
(repeat for as many files as you need)
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
.
- References:
- Compact/Repair
- From: SheldonMopes
- Compact/Repair
- Prev by Date: Re: DoCmd.OpenForm Problem
- Next by Date: Re: Lix count (readabillity) / Flesch-Kincaid
- Previous by thread: Compact/Repair
- Next by thread: Re: Compact/Repair
- Index(es):
Relevant Pages
|