CompactDatabase fails in Access 97 code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Owen Jenkins

    CompactDatabase fails in Access 97 code

    I have Access 97, 2000 and 2003 all running on a Win XP box after having
    just reinstalled XP. Among other problems, I find that Access 97 will
    not compact a database in code ...

    DBEngine.Compac tDatabase dbSource, dbDestination

    ... instead giving error 3001 - Invalid Argument. It worked happily prior
    to the XP reinstall. (I have uninstalled all versions and reinstalled
    again to no effect.)

    This is the same problem I had a few years back with an older laptop.
    See thread


    I didn't solve the problem then, and haven't found any more info in this
    group since.

    Anyone have any idea how I can get my Access 97 compact function back?

    Owen Jenkins

  • Chris O'C via AccessMonster.com

    #2
    Re: CompactDatabase fails in Access 97 code

    First guess is bad path and file names. Make a copy of the source db and
    name it a.mdb. Put it in the root directory of C:\. Run this code in an
    Access 97 module:

    DAO.DBEngine.Co mpactDatabase "C:\a.mdb", "C:\a_cmpact.md b"

    Does that work? If it doesn't, try a Windows shortcut with the /compact
    switch. Make sure you use the full path to Access 97 and the full path to
    the db. Example (all one line):

    "C:\Program Files\Microsoft Office\OFFICE97 \Msaccess.exe" "C:\database\db 1.
    mdb" /compact

    Does that work?

    Second guess is the DAO350.DLL needs to be reregistered.

    Regsvr32.exe "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO3 50.DLL"

    I just had a thought. The source db you're trying to compact in Access 97
    *is* an Access 97/Jet 3.5 db, right? Not a Jet 4.0 db?

    Chris
    Microsoft MVP



    Owen Jenkins wrote:
    >I have Access 97, 2000 and 2003 all running on a Win XP box after having
    >just reinstalled XP. Among other problems, I find that Access 97 will
    >not compact a database in code ...
    >
    >DBEngine.Compa ctDatabase dbSource, dbDestination
    >
    >.. instead giving error 3001 - Invalid Argument. It worked happily prior
    >to the XP reinstall. (I have uninstalled all versions and reinstalled
    >again to no effect.)
    >
    >This is the same problem I had a few years back with an older laptop.
    >See thread
    >http://groups.google.com.au/group/co...03906208091269
    >
    >I didn't solve the problem then, and haven't found any more info in this
    >group since.
    >
    >Anyone have any idea how I can get my Access 97 compact function back?
    >
    >Owen Jenkins
    --
    Message posted via AccessMonster.c om


    Comment

    • Owen Jenkins

      #3
      Re: CompactDatabase fails in Access 97 code

      Hi Chris,

      Thanks for the reply but this didn't help. It is not an issue of path or
      file names. I have reregisted DAO350.DLL successfully but this hasn't
      helped. And yes, it is Access 97/Jet 3.5, not 4.0.

      Owen

      Comment

      • Chris O'C via AccessMonster.com

        #4
        Re: CompactDatabase fails in Access 97 code

        When you installed Access 97, did you also install SR-1, SR-2, Jet 3.51 and
        its SPs? Make sure you also install the latest MDAC files. For Windows XP
        SP-2 or newer, you need MDAC 2.8 SP-1. If you need earlier SPs than the ones
        listed below, you'll be prompted to install the earlier ones when you try to
        install these.

        Office 97 SR-2b


        Microsoft Jet 3.5 Service Pack 3


        MDAC downloads (including component checker)


        More info


        Chris
        Microsoft MVP


        Owen Jenkins wrote:
        >Hi Chris,
        >
        >Thanks for the reply but this didn't help. It is not an issue of path or
        >file names. I have reregisted DAO350.DLL successfully but this hasn't
        >helped. And yes, it is Access 97/Jet 3.5, not 4.0.
        >
        >Owen
        --
        Message posted via AccessMonster.c om


        Comment

        • Owen Jenkins

          #5
          Re: CompactDatabase fails in Access 97 code

          Thanks! I forgot all about SP1/SP2. SP1 didn't help, but SP2 fixed the
          compact problem. I'll do the Jet updates too. Thanks again. Owen

          Comment

          • Chris O'C via AccessMonster.com

            #6
            Re: CompactDatabase fails in Access 97 code

            Glad it's working now. The SPs are easy to forget, but they're must-haves,
            especially for Office 2000.

            Chris
            Microsoft MVP


            Owen Jenkins wrote:
            >Thanks! I forgot all about SP1/SP2. SP1 didn't help, but SP2 fixed the
            >compact problem. I'll do the Jet updates too. Thanks again. Owen
            --
            Message posted via AccessMonster.c om


            Comment

            Working...