Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    99

    Unanswered: compact and repair database

    Is there a way I can set up a process to automatically compact and repair database when I close it?

    My database is very cluttered (I think) :-) and as a novice want to know how I can compact as I go along.

    Thanks
    pachamama
    www.researchbank.co.uk
    Fortune Global 500 Databank

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In order to compact a datatBase it should be closed, this means U should comapct it from another DB.

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    And the order is Application.DBEngine.CompactDatabase SourceName , DistinationName

  4. #4
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    What version of Access are you using? Up to Access 97, You would have to close the DB before compacting. Having said that, if you are the only user, you could use the SendKeys method. After Access 97, you can compact and repair on closing the DB. Go to Tools>options and I think it is on the view tab. The Microsoft Knowledge base have code for compacting and repairing at a scheduled time.

    http://support.microsoft.com/default...&Product=acc97

    David

  5. #5
    Join Date
    Mar 2004
    Posts
    7

    Re: compact and repair database

    Tools --> Options --> "General" tab
    There is a tick box (bottom left hand) for "Compact on Close", check it, and OK

    I hope this helps. I am a novice too, but I happen to know this!


    Originally posted by pachamama
    Is there a way I can set up a process to automatically compact and repair database when I close it?

    My database is very cluttered (I think) :-) and as a novice want to know how I can compact as I go along.

    Thanks

  6. #6
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Re: compact and repair database

    Originally posted by syk
    Tools --> Options --> "General" tab
    There is a tick box (bottom left hand) for "Compact on Close", check it, and OK
    That would affect all databases, not always desireable. Moreover, mostly you would want to ensure that this happens for all users specirfying it in the db itself. With the above general method, that one needs to be set on each user's computer, and may have to be manyally reset after a reinstall, etc....

    D.

Posting Permissions

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