473,396 Members | 2,030 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,396 software developers and data experts.

compacting access database from VBA code

I have an access database with some VBA code. The vba code is started by a macro and basically deletes rows from tables and loads new data from an external file. After that VBA code has run I would like the macro to compact the database so I used the RunCommand--> CompactDatabase, but it didn't do anything. Everything worked as expected but the database was not compacted and I received no error message. What did I do wrong?
Jan 23 '08 #1
1 1606
ADezii
8,834 Expert 8TB
I have an access database with some VBA code. The vba code is started by a macro and basically deletes rows from tables and loads new data from an external file. After that VBA code has run I would like the macro to compact the database so I used the RunCommand--> CompactDatabase, but it didn't do anything. Everything worked as expected but the database was not compacted and I received no error message. What did I do wrong?
You cannot Compact an 'Open' Database via a Macro or VBA code. Why not set the: Tools ==> Options ==> General ==> Compact on Close Option?
Jan 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Peter Verhelst | last post by:
Hello, Currently I am running an Access database on a windows WTS server, running Microsoft Windows 2000 server 5.00.2195 Service Pack 3. This database should be accessible for everybody in our...
5
by: lappy | last post by:
Hello, I have written a small programme to compact an access 97 database. Dim je As New JRO.JetEngine ' Compacts database Data.Mdb to Data2.mdb. je.CompactDatabase...
2
by: Simon Johnson | last post by:
Hi all, I'm writing a program that does a lot of table droping and updating.. After i've performed these steps it would be nice to run the compact and repair function on the database. How can I...
0
by: Jon S via DotNetMonster.com | last post by:
Hi all The below code is compacting a database that has a password. Unfortunately once the below code is complete the database does not have a password anymore. How do I have it so the password...
7
by: Selva Chinnasamy | last post by:
I have had problems with Inserting records then I found the KB article which has solution http://support.microsoft.com/?id=884185 Now I am trying to compact the database, used JRO to compact the...
1
by: Lyle Fairfield | last post by:
Today I asked Access 2007 to compact db1.mdb. Access 2007 showed a message to me that I did not read carefully; my recollection is that it said it could not save the compacted copy as db1.mdb,...
7
by: DavidB | last post by:
I have a standard FE/BE database. I'd like to be able to have a button on each db that allows the admin to compact the database. I am using the following code to perform the compact. Private...
1
by: Slez via AccessMonster.com | last post by:
I do a routine compact and repair on a back end MS Access 2002 database. This time I had something peculiar occur. The compact started as normal, than the following error message popped up (I...
3
by: DSSMaster | last post by:
I am trying to use windows scheduler to compact a database. In the task run line I have the following: "C:\Program Files\Microsoft Office\OFFICE11 MSACCESS.EXE" _ "C:\Files\Access\Sacroc.mdb"...
32
by: Andy | last post by:
To further follow up on my last post regarding the docmd.quit vs. Application.quit using access 2007, I noticed that docmd.quit will correctly compact the database (program file) if you have the...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.