473,779 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Me nu Bar"). _
Controls("Tools "). _
Controls("Datab ase utilities"). _
Controls("Compa ct and repair database..."). _
accDoDefaultAct ion

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 1732
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@localho st>
??????:40****** *************** **@auth.uk.news .easynet.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("Me nu Bar"). _
Controls("Tools "). _
Controls("Datab ase utilities"). _
Controls("Compa ct and repair database..."). _
accDoDefaultAct ion

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@localho st>
??????:40****** *************** **@auth.uk.news .easynet.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
2607
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
10421
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 database, so the data is in a second (back-end) database with all the tables linked. However, now when I close the database, it compacts the front end, since that's what's open, and the back-end grows. I now have to manually open and close the...
4
2081
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 added to the "Group or user names" with access to the file. But each time the Repair/Compact utility is run, it removes "Everyone" from the list. This is under Win2000. Can anyone offer some advise or suggestions? Thanks
2
2469
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 say this is the auto number fields are NOT being reset to zero. I delete the data from tables with action delete queries, then call the compact DB code which is followed by importing data to tables and subsequent append queries to other tables....
6
3085
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 particular will no longer allow new entries into the subform - the recordset of the underlying query is no longer updatable. The subform in question enters the identity and other vital info for children whose parent's ID provides the FK, linking...
6
2283
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 headlong into a process that, after the fact, had the result of overwriting the 44-meg previous size file into an 8-meg file of the same name. Has anyone ever experienced a data-loss during such a compact operation under A97? Surely, the access...
5
5233
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 compact the database. Then with no modifications to the code it works well. Any ideas anyone ? Thx & Best Rgds,
2
21294
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
5602
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 a set of text files into already-defined tables. Every time I run it, the database swells considerably, so it would be good to be able to automatically run the compact/repair feature at the end of this script. I've tried the compact-repair...
0
9633
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10305
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8959
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7483
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.