Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    NJ
    Posts
    2

    Question Unanswered: Schedule database repair and compact?

    Could anyone tell me where I might find a sample script to run the DSN program that repairs and compacts a database? Need to automate this task.

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    Unfortunatelty this task cannot be automated from within a database. A database can only be repaired or compacted while no-one is logged in.

    You can create a program to open another database/program that will then in turn close the original database and then compact/repair it.

    John
    J.

  3. #3
    Join Date
    May 2003
    Location
    NJ
    Posts
    2
    I can stop the DB, but do you knwo of any code to compact and repair the db?



    Originally posted by johncameron
    Unfortunatelty this task cannot be automated from within a database. A database can only be repaired or compacted while no-one is logged in.

    You can create a program to open another database/program that will then in turn close the original database and then compact/repair it.

    John

  4. #4
    Join Date
    Apr 2002
    Posts
    139
    Have a look in the help files at

    DBEngine.CompactDatabase

    hth

  5. #5
    Join Date
    Dec 2001
    Posts
    79
    Here's some example code to compact a list of databases:

    http://www.peterssoftware.com/cal.htm

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

Posting Permissions

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