Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 28th, 2006, 06:09 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default Automatic Compact and Repair

Hello everyone.

I’m looking for some advice on the best way to automate a database to do two things.

1. A very quick repair, just to make sure everything is in line.
2. An automatic Compact and Repair.
3. Make backups within a created folder “example (My Documents)

Ultimately I would like it if I was able to find some code that would automatically find the database within list of databases, back it up in a folder I have assigned for it to be backed up in, Compacted and Repaired then the new Compacted, repaired and tweaked database would go back to the starting location.

If anyone has any advice or experience with this, I would be great full to hear from you

Thanks for your help

Corey


 
Old March 29th, 2006, 08:43 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Where do you want to run this from? Most of it can be done from a script. I will have to look up the compact and repair. I usually set all my databases to compact on close, which keeps issues to a minimum.



mmcdonal
 
Old March 29th, 2006, 09:08 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Here is a free utility that will do this for you.

Please note that it is USUALLY not necessary to repair a database unless it is in development. Once it goes into production, only compacting should be necessary.

Regardless, you can't really compact and repair a database in code if the database is 2000 or later. The datbase code and system information is stored in a BLOB instead of discrete records, as with earlier versions, so individuals items can't be rectified using DAO CompactDatabase, for example. Only the menu, switch (/Compact) or this utility (and others like it) will do the trick.

HTH

mmcdonal
 
Old March 29th, 2006, 09:09 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hehe, sorry: http://www.trigeminal.com/lang/1033/...asp?ItemID=2#2



mmcdonal
 
Old March 29th, 2006, 10:49 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default

This is great information. Thanks Mmcdonal






Similar Threads
Thread Thread Starter Forum Replies Last Post
Compact and Repair Access Database raguapk VB How-To 8 May 23rd, 2013 10:00 AM
is there any auto compact repair utility to buy ? surajguru Access 5 October 15th, 2005 02:45 PM
Compact/Repair Access Database On The Fly kevorkian Classic ASP Databases 3 November 22nd, 2004 06:57 PM
Compact And Repair Access Database myedu2k4 Pro VB Databases 1 May 25th, 2004 01:43 AM
Compress and Repair Damaged Database owain Access 4 June 30th, 2003 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.