Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy and Compact database (Access97)

    I have a need to regularly compact a database.
    How can i do this through VB ?
    I have successfully created a compacted copy of the db which is great but i also need to compact the original as part of the same procedure.
    Does anyone have any experience here please ?

  2. #2
    cfe5001
    Guest

    Re: Copy and Compact database (Access97)

    After the code that copies and compacts to a new file, add the following code ...

    SendKeys "%TDC"

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

    Re: Copy and Compact database (Access97)

    Are you asking about VB or VBA? Whenever you compact the database, it creates a copy of the database. When you run compact from an open database, it handles the details for you, but it still creates a compacted copy and then deletes the old database and renames the new copy. If you do this from code, you have to do the same thing. What specifically do you need help with?
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy and Compact database (Access97)

    call me cautious if you like but what does this do ?

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy and Compact database (Access97)

    This is VBA in the Access DB that i want to compact.
    When the user runs a process to get info from another db (Pervasive SQL) and format it into html pages the db grows by several MB. The same access db also supports the asp pages that serve the data to the web visitors so need to be as small as poss for ftp purposes.
    not too sure this will make it any clearer, I need the functionality of Tools|database utilities|compact db but through vba code so that the menu option can be removed

Posting Permissions

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