Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Question Unanswered: VB Code to campact and repair

    we've currently got a db that runs as the data depository for a piece of VB code, but just recently the data base has been corrupted by some unknown factor now you can repair the database past the corruption but the repair doesn't last unless you also compact it aswell, now i REALLY don't want to come in to work at midnight to do this and would like to setup a simple piece of code that can be run by the user to fix it with out involving me, THANKS
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  2. #2
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Here are some links that might help:

    "Compact A List" is a free MS Access database that allows you to backup, repair, and compact a saved list of Access database files. It also saves the results of these actions in a table for later viewing, making it suitable for batch or scheduled execution.

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

    Also, there's a nice utility for scheduling compacting operations from Calvin Smith called "CompactIt" at:

    http://home.sprintmail.com/~calvinsmith/compact.htm

    You can also use the TSI SOON utility to close a database, compact it, and then open it again (it also copies NT file permissions to the new file):

    http://www.trigeminal.com/lang/1033/...asp?ItemID=8#8

    Another utility is Compact Current MDB From Code:

    http://briefcase.yahoo.com/lylefair

    FMS, Inc has a product called Total Visual Agent 2000 that handles scheduled compacting and much more:

    http://www.fmsinc.com/products/Agent/index.html

    Or, you can use the macro method.
    http://support.microsoft.com/default...b;en-us;100923

    or compact at a scheduled time.
    http://support.microsoft.com/default...b;en-us;158937

    Or, if a single user, use the sendkeys method
    SendKeys "%TDC", False

    Just add the code to a command button.

    David

  3. #3
    Join Date
    Nov 2002
    Posts
    272
    You could look into the CompactDatabase method of the DBEngine object in the DAO object library.

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    the manual method of fixing it s file -> repair, file -> compact
    Note this is access 2.0, yes i know i'm trying to talk the db's owner into letting me upgrade it but atm he wont let me do it
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    this is what i'm looking for but i can't find the damn thingo rthe repair one for that matter the help file has no associated page with compactDatabase or repairDatabase

    Originally posted by ivon
    You could look into the CompactDatabase method of the DBEngine object in the DAO object library.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  6. #6
    Join Date
    Nov 2002
    Posts
    272
    Access 2.0 eh? I'm afraid I can't help you then.

Posting Permissions

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