Results 1 to 8 of 8
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Compact and Repair Database (A2K SR1)

    Is there a way to have Access automatically Compact and Repair a database when exiting the database? I have a command button that the user presses to exit the database, however, can't figure out how to code this. I also tried this in a Macro, but received a message that you can't compact and repair a database within a macro.
    Regards,

    Gary
    (It's been a while!)

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Compact and Repair Database (A2K SR1)

    In Access 2000, this is an option you can set from the Tools-->Options-->General dialog. Look for Compact on Close in the lower left corner.
    Charlotte

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Compact and Repair Database (A2K SR1)

    Charlotte,

    Once again, many thanks for your help. It figures it was this easy and I could not figure it out.....
    <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>
    Regards,

    Gary
    (It's been a while!)

  4. #4
    New Lounger
    Join Date
    Oct 2001
    Location
    Perth, Western Australia
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compact and Repair Database (A2K SR1)

    Hi Charlotte

    Can you tell me how you would do this in Access 97? DO I have to have a second db that compacts the first one then auto closes?

    Many thanks

    Dean

  5. #5
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compact and Repair Database (A2K SR1)

    I wish I were as bright a Charlotte, but while waiting for her here is my 2 cents worth.... As you know Access97 does not have the Compact on Close capability that Access2000 does. You will have to use the article you are referring to or use other schemes to do your compact.

    hth,
    Jack

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Compact and Repair Database (A2K SR1)

    Sorry, but Access 97 doesn't have that capability. You can compact the database from code, but you'll have to follow the instructions in the knowledgebase article.
    Charlotte

  7. #7
    New Lounger
    Join Date
    Oct 2001
    Location
    Perth, Western Australia
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compact and Repair Database (A2K SR1)

    Thanks, Charlotte

    But could you tell me which knowledge base article and where it is?

    Have a good weekend!

    Regards
    Dean

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Compact and Repair Database (A2K SR1)

    I'll do better. Go to <A target="_blank" HREF=http://www.mvps.org/access/modules/mdl0020.htm>The Access Web</A> and download the utility that lets you compact a 97 database from code.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •