Anyone know how to Compact and Repair using VB?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoble1
    New Member
    • Jul 2008
    • 246

    #1

    Anyone know how to Compact and Repair using VB?

    Is there a way to write code to compact and repair your database? I am trying to compact and repair in code before I save a copy in the server. I know you can go to manage, but trying to make a better way.
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    A couple of things.

    First, as illogical as it seems, C & R is considered to be a common cause of data corruption! Because of this, the native Access "Compact on Close" option is possibly one of the worst features they've ever come up with! You should always back up an Access file before doing a C & R, which is the reverse of what you're speaking of doing.

    Secondly, one has to ask why you feel the need to do this so often that going into menu to do it is a burden? With a correctly designed app it is seldom necessary to do a C & R on a regular basis.

    Linq ;0)>

    Comment

    • anoble1
      New Member
      • Jul 2008
      • 246

      #3
      When I close each night, I backup a copy of my database to the server. When I do it without C & R the database is huge. Some network users have slower internet connection. It goes down quite a few MB.

      Comment

      Working...