1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Compact Access database

Discussion in 'Business Applications' started by imaley, Mar 30, 2004.

Thread Status:
Not open for further replies.
  1. imaley

    imaley Thread Starter

    Joined:
    Mar 30, 2004
    Messages:
    1
    Hi :

    is it possible to compact a password protected Access 2000 database from code? I tried this:

    DBEngine.CompactDatabase "c:\backend.mdb", "c:\backend1.mdb", ";pwd=password"

    but I get an "Invalid password" error. Yet the password correctly opened the backend.mdb without a fuss in normal circumstances.

    Any help would be greatly appreciated.

    Thanks,

    Ian
     
  2. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,746
    First Name:
    Anne
    I don't think you can compact a DB from code unless the code is run from another DB.

    See... a DB has to BE closed to compact it.
    So it stands to reason that you can't be running code while it's closed...
     
  3. AbvAvgUser

    AbvAvgUser

    Joined:
    Oct 3, 2002
    Messages:
    2,281
    You can compact an Access database

    from a standalone VB application
    OR
    from another access database using VBA
    OR
    thru Tools > Database Utilities > Compact and Repair Database
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/216081

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice