Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Compactng a database from another database (Access 2003 SP2)

    Is there a way to compact a database from another database, eg in VBA code?

    This is required once a month to keep the database at a reasonable size.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Compactng a database from another database (Access 2003 SP2)

    See for example <post:=665,630>post 665,630</post:>. The code posted there requires a reference to the Microsoft DAO 3.6 Object Library.

    You can also use a command line to compact a database:
    <code>
    "C:Program FilesMicrosoft OfficeOffice11MSAccess.exe" "HatabasesMyDatabase.mdb" /compact
    </code>
    You can call this command line from VBA using Shell:
    <code>
    Shell """C:Program FilesMicrosoft OfficeOffice11MSAccess.exe"" ""HatabasesMyDatabase.mdb"" /compact"
    </code>
    Note the use of double double quotes within the string that is passed to Shell.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Compactng a database from another database (Access 2003 SP2)

    Thanks Hans, and you explanation is clear as usual.

Posting Permissions

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