473,513 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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/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

Jun 27 '08 #1
5 2688
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

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.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/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.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #2
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

Jun 27 '08 #3
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/he...449951033.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
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.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #4
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

Jun 27 '08 #5
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.com
http://www.accessmonster.com/Uwe/For...ccess/200805/1

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3253
by: Zachariah | last post by:
Part of a Windows Service app I created in .NET 2003 has the following code: Dim stOutPath As String Dim stTableName As String Const strDBPath As String = "C:\test_be.mdb" acApp = New...
1
2325
by: Christopher Brandsdal | last post by:
Hi! I found a database tool-script that has a functin for compacting the database.... What is the point of compacting the database? Is it necessary? Anyone know the advantages of doing this??? ...
4
4677
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another...
8
3359
by: Owen Jenkins | last post by:
Hello. For years I've been using the DBEngine.CompactDatabase code to make backups of backend databases. But now I've struck a baffling problem where I get an Invalid Argument error. This...
0
1120
by: S. van Beek | last post by:
Dear reader, By using the CompactDatabase command I discovered the following unpleasant situation: DBEngin.CompactDatabase "DB_a", "DB_b"
1
1699
by: S. van Beek | last post by:
Dear reader, By using the CompactDatabase command I discovered the following unpleasant situation: DBEngin.CompactDatabase "DB_a", "DB_b" The above sentence works perfect, but if I will use...
5
3518
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
12
1871
by: keepyourstupidspam | last post by:
Hi, I am writing a windows service. The code runs fine when I start the service when my machine is running but it fails to start automatically when the machine reboots. The code bombs out when...
3
1508
by: pburling | last post by:
I have been reading the posts regarding the CompactDatabase method and would like to say Thanks to everyone, especially Mr.Steele. I have taken his advice and make a backup from the Backend before...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7161
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.