Compact Repair Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramdil
    New Member
    • Dec 2007
    • 46

    Compact Repair Database

    HI All

    Currently i have a access database and i am currently doing compact and repair using the tool in database.Can any one help me by giving me the code for doing the same thing so that i can call that method in a button click so that users can do it their own.Thanks in advance
  • blad3runn69
    New Member
    • Jul 2007
    • 59

    #2
    depends on the version of access. see http://www.thescripts.com/forum/thread568193.html , looks a bit trickier with ms access 97

    If you are using 2000+ maybe try

    add a new module
    add function (must be only code in module):

    Function CompactRepair()
    CommandBars("Me nu Bar"). _
    Controls("Tools "). _
    Controls("Datab ase utilities"). _
    Controls("Compa ct and repair database..."). _
    accDoDefaultAct ion

    End Function

    call the function from your buttons Click event
    I have tried on msaccess 2002/2003 and works OK.

    good luck ramdil :)

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      Important to remember is that compacting a database is a common cause of corruption! It should never, ever be done until the db has first been backed up!

      Linq ;0)>

      Comment

      • blad3runn69
        New Member
        • Jul 2007
        • 59

        #4
        excellent point missinglinq, and thank you for a great mousemove tutorial :)

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          You're welcome, Blad3! The How To section is always a great place to browse thru when you have a few minutes! Lots of great stuff in their, all of it generated because it addresses things that have been asked beacoup times.

          Linq ;0)>

          Comment

          • ramdil
            New Member
            • Dec 2007
            • 46

            #6
            Thanks for the replies.I will try and get back to you .Any thanks for all responses.


            Originally posted by blad3runn69
            depends on the version of access. see http://www.thescripts.com/forum/thread568193.html , looks a bit trickier with ms access 97

            If you are using 2000+ maybe try

            add a new module
            add function (must be only code in module):

            Function CompactRepair()
            CommandBars("Me nu Bar"). _
            Controls("Tools "). _
            Controls("Datab ase utilities"). _
            Controls("Compa ct and repair database..."). _
            accDoDefaultAct ion

            End Function

            call the function from your buttons Click event
            I have tried on msaccess 2002/2003 and works OK.

            good luck ramdil :)

            Comment

            Working...