473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

where I made mistake on compact the current database?

Dear all,

My aim is to compact and repair current database, I got the following code
from http://www.mvps.org/access/general/gen0041.htm

Option Compare Database

' ***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

'-----------------------------------------------------

'then I made a form, and a command button "command1"

Private Sub command1_Click()
Call CompactDB
End Sub

'-------------------------------
but when I click on the command button, there occured a error message no. 5.
something like "invalid process ...."

where I made mistake?


Nov 13 '05 #1
3 1710
thanks a lot, but I get confused....it does not work on my access 2000. Very
strange thing.

anybody got an idea?

Paul

"Trevor Best" <nospam@localhost>
??????:40***********************@auth.uk.news.easy net.net...
Paul T. Rong wrote:
Dear all,

My aim is to compact and repair current database, I got the following code from http://www.mvps.org/access/general/gen0041.htm

Option Compare Database

' ***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

'-----------------------------------------------------

'then I made a form, and a command button "command1"

Private Sub command1_Click()
Call CompactDB
End Sub

'-------------------------------
but when I click on the command button, there occured a error message no. 5. something like "invalid process ...."

where I made mistake?

From the code you posted, nowhere, it works fine (I just copied and
pasted it and tried). Your problem must lie elsewhere or there's
something else about your environment that's influencing it.

--
Error reading sig - A)bort R)etry I)nfluence with large hammer

Nov 13 '05 #2
Paul T. Rong wrote:
thanks a lot, but I get confused....it does not work on my access 2000. Very
strange thing.

anybody got an idea?


I should confirm that I tried it on Access 2002, do you have all the
latest service packs installed?

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 13 '05 #3
I did install the latest office 2000 service pack 3.
Thanks for confirmation, maybe I should upgrade to Access 2002.

Paul

"Trevor Best" <nospam@localhost>
??????:40***********************@auth.uk.news.easy net.net...
Paul T. Rong wrote:
thanks a lot, but I get confused....it does not work on my access 2000. Very strange thing.

anybody got an idea?


I should confirm that I tried it on Access 2002, do you have all the
latest service packs installed?

--
Error reading sig - A)bort R)etry I)nfluence with large hammer

Nov 13 '05 #4

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

Similar topics

2
by: lestersal | last post by:
How would I compact a database on Open using code? I presume I'd have to use the Autoexec macro but what code do I put in the procedure called by Autoexec? Thanks, Alistair
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
4
by: Ken Winters | last post by:
Whenever I run the Repair/Compact on my database, the security settings on the file change. A 3rd party application can only access the database over the network when the username "Everyone" is...
2
by: Greg Strong | last post by:
Hello All, I've written code in a test database with test data. Everything seems to be working except compact database in VB code per http://www.mvps.org/access/general/gen0041.htm. The reason I...
6
by: GaryDave | last post by:
My school registration database has not been quite right after a recent compact and repair (done while I was away). Though most of the many forms and subforms are working normally, one form in...
6
by: MLH | last post by:
I just used Tools / Database Utilities / Compact Database in Access 97 for the first time. Unlike Access 2.0, it does not ask me to furnish a filename for it to compact into. It just launched...
5
by: Prakash | last post by:
Does anyone know how to compact a table (only) ? I'm using some code o move rows up & down in a continuous form & it works fine, but after some usage the rows refuse to move up or down until I...
2
by: Simon | last post by:
Dear reader, How can I use a command in the current mdn to compact and repair the mdb. In which the source file is the current database.
3
by: jonnyboy | last post by:
Hello again, Thanks to Scott for helping out with my last query. I've had a good look round but I can't find anything that carries out what I'm trying to do. I've got a function that imports...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.