Results 1 to 7 of 7
  1. #1
    Riamor is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    6

    Repair DBthrough VBA

    Hi I want to repair several databases through VBA codes. Is there a way I can pass the database file, and repair it? Thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    there is a COMPACTREPAIR action in the database library

  3. #3
    Riamor is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    6
    Can you be more specific? How do I call it through code? Thanks

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    try something like:
    Code:
    dim db as dao.database

    set db 
    currentdb

    db
    .compactrepair 

  5. #5
    Riamor is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    6
    There is no command like that. Anyone able to help me out here, with the actual code?

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Riamor View Post
    There is no command like that. Anyone able to help me out here, with the actual code?
    it takes a little bit of exploration:
    Code:
    application.compactrepair

  7. #7
    Riamor is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    6
    Thanks. It works fine for me in Access 2003. However, just found out the client I'm doing this for has Access 2000. And of course, application.compactrepair doesn't work from 2000! Do you know what the code was back then? There's always something!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. repair command SQL
    By haocaocu in forum Programming
    Replies: 1
    Last Post: 07-25-2010, 07:01 AM
  2. Run Companct and Repair
    By jgelpi16 in forum Programming
    Replies: 9
    Last Post: 06-14-2010, 11:23 AM
  3. Compact and repair on close
    By colotazzman in forum Access
    Replies: 2
    Last Post: 05-20-2010, 02:04 PM
  4. Best Access Repair Utility?
    By syoo in forum Access
    Replies: 6
    Last Post: 01-29-2010, 06:35 AM
  5. Automate Compact and Repair process
    By tracerbullet in forum Security
    Replies: 2
    Last Post: 01-14-2010, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums