Results 1 to 2 of 2

Thread: How to know a Database needs compact and repair?

  1. #1

    Thread Starter
    Lively Member Mahdi Jazini's Avatar
    Join Date
    Feb 2014
    Location
    Iran / Tehran
    Posts
    89

    Question How to know a Database needs compact and repair?

    As you know in (Windows OS > Disk Defragment) there is a button with name of (Analyze)

    Is in (VB6 > ADO) an option like this:

    True (the database needs to compact and repair)

    False (the database doesn't need compact and repair)

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to know a Database needs compact and repair?

    This assumes Conn is open:

    Code:
    Dim Savings As Long
    
    Savings = Conn.Properties("Jet OLEDB:Compact Reclaimed Space Amount").Value
    You could use the Savings estimate value to decide whether to compact or not. However this tells you nothing about whether repair is needed.

    But a "repair" operation is faster and more likely to succeed if not ignored for a long period of database updating. Thus it is good practice to "compact and repair" fairly often.

    There is no crystal ball to tell you when to do it though. Don't wait for errors before doing it.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width