Compact On Close
Apr 19, 2007Hi,
I apply Compact On Close (Tools->Option->General tab). So, every time, it will compact the database when closing the file.
However, will it do repair the database automatically? It seems just do compacting.
Hi,
I apply Compact On Close (Tools->Option->General tab). So, every time, it will compact the database when closing the file.
However, will it do repair the database automatically? It seems just do compacting.
I am using Access 2010.
Under options, current database I have DESELECTED "compact on close"
Still all my databases are compacting on close. How can I prevent Access to compact on close?
Problem is that we work under Citrix and sometimes things happens with Citrix that they have to reboot all the servers.
The databases tries to close and compact and don't get enough time, so I get mdb copies.
Besides I recently had only the compacted database1.mdb while my file Name.accdb was gone, so again the compact was wrong.
I currently manually run a compact and repair on the backend of a database at work, but was wondering if it might be sensible to set it to compact on close so that (in theory) it is done at least daily and therefore shouldn't take much time?
The back end resides on a network server, which is backed up continuously, so in theory it should be easy enough to roll back to a backup copy should anything untoward happen.
Can you compact on close in an access 2000 runtime enviorment?
Also, if i select the option to compact on close will it work on every computer i copy this database to? Or is it a property of that computer?
I cannot cause a database to refrain from dropping several table indices during a Compact on Close operation. I am running Access 2010 under Windows xp.I have created a database that merges data in a linked text file with data in a linked database, appending the results in a local table. The database has the Compact on Close option set. The table has 27 indices (because most of the fields either are coded or are potential select or sort fields) and nearly 1 million records.
I run a delete query to clear the contents of the table, I close (and compact) the database, I reopen the database, and I run the append query. The indices in the target table are intact. I close (and compact) the database again; when I reopen the database, indices are missing -- sometimes about 10, other times nearly two dozen!
This table is linked to a larger system, which contains code to run the sequence outlined above. Whether run manually or in code, as stand-alone or as a component, indices are dropped. When I close the database with the table containing no records, the indices are not affected. After appending records, but before closing, the database contains 1.66GB. The drive on which the database resides has 42GB free.As suggested with regard to a number of other unexplainable issues, I have created a new database and imported all objects from the original database. The results persist. The larger system performs accurately without the indices, but the performance against a table this massive is horrible.
How would I use the Access 2010 setting, 'Compact on close'?We have a back end on a server and many users with front ends on their computers. So would I set 'Compact on close' on the back end? And then it would compact when the last user logged out?
View 3 Replies View Related "how to COMPACT the DB by introducing delay of 10 seconds and then close the DB".In the Database, I'm able to accomplish the "Compact" the database using the function below.
Function Compact()
SendKeys "%(FMC)", False
End Function
As my DB is quite huge, the Compact action takes around 10 seconds to complete.Now, i would like to Close the Database after Compacting the DB. I tried including "DoCmd.Quit" in the function. The commands in the function, closes the DB but the Compact function doesn't seem to have executed as it needs 10 seconds to complete.
Function Compact()
SendKeys "%(FMC)", False
DoCmd.Quit
End Function
how to introduce this delay of 10 seconds and then close the DB.
Hi everyone,
hopefully you'll be able to help me out with this one, been searching but can't find the exact answer.
I am running a database with multiple users, max of 10, currently the database autocompacts when it is closed, however this takes time every time anyone closes it.
what i am looking to do is have the database automatically compact but only once a day. Any ideas???
many thanks
Hi All,
Is there any way to determine the right time for compacting a database?
I mean say for example - is there any way (thru a property/system table) which I can refer to see how many records are marked for deletion?
This way - I can compact the database ONLY if there are large number of records marked for deletion?
I have searched all the places I could but could not get the answer I want. :confused:
Thank you,
Dev.
:)
Goodmorining,
I use Access XP and I have a problem with the Compact and Repair function.
When I start this function via the normal menu's access doesn't seem to respond anymore. I can leave my comp on for hours dut nothing happens.
He does make a copy (db1) with the same volume but then it stops.
Does anybody else has this problem and what can I do about it
Thanks
Kind regards
Rolf
Hi
does anyone know how i would make my database compact & repair itself either when i open or close it?
tried to do it via a macro but it says that it can't compact and repair when a macro is running :(
:confused:
I know this has been discussed before but I have not been able to find a solution for my problem.
I have a database with linked tables from the back end database. The normal size is about 4.5 mb but after doing some work on a fairly simple form and a function with Select Case statements and simple SQL (the SQL was here before that change) the size has risen to 33Mb. This actually doubled to 66Mb earlier today after a very minor change but did compact back to 33Mb.
I have the Jet Compact Utility to no aval. I have tried creating a new database and imported all the objects from the original but again to no avail.
Help please???
Kevin
Hi all,
This morning i opened up my database, it worked fine, ie could add new records on to the forms etc but when i went to look at my tables, queries, forms etc nothing was there and an error message about indexes came up.
I had a look through this forum and found a lot of useful information on compacting and repair. I compacted my database and it went from 89KB to creating a new database with only 28KB. The new one which it created works perfect for me and i have deleted my old one, as still no tables, queries etc showed up.
I didn't even have a clue i should have been compacting my database regularly, stupid i know but we all learn. My question is, when looking at threads i have noticed that when people talk about compacting, repair is mentioned too, do i need to run the repair tool now on my database? Or is it ok. Im not entirely sure of its function, i will keep looking though, Thanks for any replys :)
Hi guys,
This is just for discussion really. What does Compact and Repair actually do? If I was to set my database to compact and repair on close, am I in danger of losing any data, formatting on forms or anything? What are the pros and cons?
I would really appreciate some replies. Thank you in advance :)
I have an access 2000 database, which we copied from it's original location to another computer. I now am trying to modify/update the file, and have discovered an unusual problem. The filesize is roughly 75 megs! It is not a huge database, the biggest table has 2200 entries x maybe 8 fields.
There apparently had been corruption in the 2200 line table, as when I first looked into it, it had something like 275,000 rows. So I deleted back to the 2200 "good" rows of data. Figured I had the filesize problem fixed. But it won't shrink. Tried compact/repair and it didnt help. Crunched data for a long time, seemed to be working, but the filesize turns out nearly the same.
I then created a new database, and imported all of the info from the "big" one. Filesize = 1.5 meg. Great! not really. I cant get any of the code to copy over and I am not a VBA guy. All of the form buttons return error messages, and when I look into the event procedures there is no code. I tried copying all that code over, and it appears to have copied, but it doesnt work.
Maybe someone out there can offer suggestions? Thanks, Harry Manvel
When I 'compact and repair' on my office computer, two tables' autonumber fields become corrupt (I get a duplicate autonumber)
I took the original .mdb home and 'compact and repaired' it at home and to my surprise the tables didn't become corrupt.
Any ideas why the compaction causes errors in the office but not in my home?
Thanks very much
Hi,
Could anyone explain to me what compact and repair actually does? Made a backup copy of my database and did the c and r and reduced the size greatly! Has it lost data? Just would be good to understand how this works.
Thanks
Sam
I have a macro that will copy the database to a folder upon quiting.
The databse also is enabled from the options to compact and repair upon exit.
Problem is the copied databse will be always not compacted becaue the macro will run 1st before quiting (and hence before compacting).
is there a way around it
I have search the post and I found several articles about compacting and repair the DB. I just installed 2007. So you think that had an issue with compacting. Before I installed 2007 I had no problems at all. I even tried to import tables, forms and etc. into a new DB. I get error messages there as well.
I can say when I was working in 2007. I had to open the 2007 DB in exclusive. As of now I am just fishing for answers.
Bottom line I must have done something while working in 2007.
Any Ideas would help.
PS. I can go into the db with no problem at all, which is really strange. But when I create a new DB I can't import any of the tables or forms.
This is a very general question. so I am not sure if it has been asked before.
I know that compact and repair can sometimes fix problems with the database.
Should it be done only when problems seem to be creeping in? Or should this be done on a regular basis - say once a week or once a month?
Can compact and repair be set up to run either on a specified day of the week (for example every Monday), or day of the month (for example the first of each month)?
Alternatively can I have it run automatically when the database is closed?
If so, how would it be done?
I am using A2003 with Windows XP.
Okay... unlike my last post (although unintentional), this is legitimate.
Whenever I do a compact and repair on my database, access crashes and offers to attempt to repair my db. IF I allow it to do that, it will blow away all of my VBA code and so everything stops working.
If i uncheck the repair box, access will just close. I can reopen my db myself and it's find. I'm not sure about any repairs (never understood, what it's repairing), but it's definately compacted any everything is fine.
So why does it crash and why does it eat my db unless i uncheck the box upon crashing?
I have built a DB in Access 2002 which includes an automated Compact and Repair button. My problem is that the DB, (I have just found out) must run on 97. The code I am using is as follows:
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
This is producing an error in 97 because, I belive, the compact and repair are two seperate headings. Can someone advise me where I'm going wrong or even correct my code for me? Thanks!
I understand how to compact and repair and also the fact that you need to do it so that you can increase the efficiency of your database, but my question is why? I have a database that is used fairly heavily all day by 4 to 5 users. At the beginning of the day the file is about 91 mb, by the end of the day the file size is about 133 mb. Why does it grow so much in just an 8 hour period? What causes access to need to be compacted and repaired?
View 2 Replies View RelatedI have an Access database that's on our in-house server. This database has never been compacted/repaired. Recently our server crashed (but we were able to retrieve the database). Does the fact that the database has not been compacted have anything to do with the server crashing? Could that have affected it in any way?
Also, how often should the database be compacted/repaired?
Thanks for your help!
Hi,
I was wondering if anyone might be able to help me. What i'd like to do is to be able to get the access to trigger compact and repair database tool automatically just before it shuts. Is it feasible? or has to be done manually?
Thank you in advance