×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Repair/Compact DB

Repair/Compact DB

Repair/Compact DB

(OP)
Hi,

I'm developing an application where I want to provide a user with the option of Repairing/Compacting a database.
I've never done this before so I'm not sure if I'm on the right track. The database I'm trying to repair is "CatalogDB.mdb" and it's in  the same directory as my application.

Does my code below look approximately right?

Me.Application.CloseCurrentDatabase
DBEngine.RepairDatabase app.path & "\CatalogDB.mdb"
DBEngine.CompactDatabase app. path & "\CatalogDB.mdb", app.path & "\CatalogDB.mdb"

I have this code under a command button and when I click on the button my form closes and my project stays open. To be honest, I'm really not sure whether it's working.

Thanks for any help.

MBaddar

RE: Repair/Compact DB

Sounds like it's working. You could always check the file size in Windows Explorer before and after pushing of the button.

Just a thought.

ljprodev@yahoo.com
ProDev
MS Access Applications

RE: Repair/Compact DB

(OP)
Hi Lonnie,

That's a good idea. You know, though, I just noticed that my project is closing. So, I don't think anything is executing after my closecurrentdatabase line. But, I'll check your idea about looking at the filesize.

Thanks,
MBaddar

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close