Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / May 2008

Tip: Looking for answers? Try searching our database.

CompactDatabase fails in Access 97 code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Owen Jenkins - 12 May 2008 05:46 GMT
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.CompactDatabase 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/comp.databases.ms-access/browse_thread/thread/
4dca655b30e0e93d/c403906208091269?hl=en&lnk=gst&q=compact+fails#c403906208091269


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 - 12 May 2008 07:01 GMT
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.CompactDatabase "C:\a.mdb", "C:\a_cmpact.mdb"

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\db1.
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\DAO350.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

>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
[quoted text clipped - 16 lines]
>
>Owen Jenkins
Owen Jenkins - 13 May 2008 06:56 GMT
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
Chris O'C - 13 May 2008 16:09 GMT
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
http://office.microsoft.com/en-us/help/HA010449951033.aspx

Microsoft Jet 3.5 Service Pack 3
http://support.microsoft.com/kb/172733/en-us

MDAC downloads (including component checker)
http://msdn.microsoft.com/en-us/data/aa937730.aspx

More info
http://support.microsoft.com/kb/240377/en-us

Chris
Microsoft MVP

>Hi Chris,
>
[quoted text clipped - 3 lines]
>
>Owen
Owen Jenkins - 15 May 2008 01:04 GMT
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
Chris O'C - 15 May 2008 12:37 GMT
Glad it's working now.  The SPs are easy to forget, but they're must-haves,
especially for Office 2000.

Chris
Microsoft MVP

>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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.