473,591 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compacting a database on close


Hi I have a database that I would like to be able to compact when the
exit button on the main form is clicked. Can anyone help with this?

TIA

Colin
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
2 3272
If you are the only one with the database open and if you have Access 2002 (and perhaps
2000, I don't remember), one of the options under Tools|Options is Compact On Close. DON'T
try compacting a database that someone else may have open.

--
Wayne Morgan
"ColinWard" <cw***@nospam.c om> wrote in message
news:3f******** *************@n ews.frii.net...

Hi I have a database that I would like to be able to compact when the
exit button on the main form is clicked. Can anyone help with this?

Nov 12 '05 #2
ColinWard <cw***@nospam.c om> wrote:
Hi I have a database that I would like to be able to compact when the
exit button on the main form is clicked. Can anyone help with this?


When the user exits the FE attempt to rename the backend MDB preferably with todays
date in the name in yyyymmdd format. Ensure you close all bound forms, including
hidden forms, and reports before doing this. If you get an error message, oops, its
busy so don't bother. If it is successful then compact it back.

See my Backup, do you trust the users or sysadmins? tips page for more info.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #3

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

Similar topics

1
2125
by: Rene Crespo | last post by:
Hello, Following my earlier posting regarding my Error On Exit: --------------------------------------------------------- I get the following error when compacting my MSAccess 2000 database: 'TempMsysAccessObjects' Already Exists" I have read the help file with this topic but can't seem to eliminate the
1
940
by: ColinWard | last post by:
Is there a way to compact the current database when the user clicks the exit button. Alternatively, what is the command line switch to compact the database when the user opens the database? Thank you Colin Ward
5
2641
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 network, so for the time being, I have changed the permission for the .mdb file to Everone -> Full control (I know this is not professional, but I'll sort out the security issues later). When this database is opened, and closed again, it is...
5
2958
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 "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Dump\DataOld.Mdb", _ "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Dump\Data.Mdb"
3
1355
by: Pachydermitis | last post by:
Hi everyone, This is not the forum for Windows permissions, but I figure this has to be an issue one of you access experts has had to deal with. I have an XP system with an access db on it. The directory has permissions so that the warehouse user can read/write. Everything works great until I log in as admin and open the access database. When the database closes it compacts and rewrites itself to the directory. Now the permissions on...
7
2057
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 Sub bCompact_Click() On Error GoTo Err_bCompact_Click CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefaultAction
1
2269
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 shortened the path for this post): Microsoft Access can't delete G:\......\MW-Estimate_be.mdb after compacting it. The compacted database has been named G:\......\db1.mdb. It then goes on to explain that the original database wasn't deleted...
3
3837
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" /compact In the task start in box I have the following "C:\Program Files\Microsoft Office\OFFICE11" The database starts to compact and then returns the message
32
2327
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 "Compact on Close" option set for the current database. However, even with Compact on Close set, if you use the Application.Quit acQuitSaveNone, the compacting will not fire. This behavior actually seems desirable, as you can now make a program...
0
7934
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
8236
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
7992
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
8225
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5732
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
5400
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
3850
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3891
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1465
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.