Creation of db1.mdb, db2.mdb etc

JohnPapa

Registered User.
Local time
Today, 09:18
Joined
Aug 15, 2010
Messages
1,043
Does anyone know why files such as db1.mdb, db2.mdb etc get created automatically?

Can the creation be disabled?

Thanks,
John
 
Last edited:
What that usually means is that, during a compact and repair, the original file could not be deleted so the file remains. During a compact and repair, the process involves making a copy of the database (hence the db1.mdb, etc.) and deleting the original and renaming the db1.mdb to the original file name. So, something is keeping it from happening.

Make sure all users have full read, write AND delete writes on the folder where the database file is located.
 
Bob,
Maybe I now know the reason for the appearance of the various dbs. In my application I do a compact and repair on exit. One of the user logins has full rights and does not. Maybe the various dbs are created when the user logs in without the full rights.

John
 
i would be careful about using compact and repair, for that reason.

access creates a temporary database, and then copies it back. so if you get left with a db1, etc, it probably means the C & R did not complete.

A real problem, is if anything goes wrong with the C&R, and you end up with a corrupt database. Personally, I would always take a windows copy and do a C & R manually.

C & R is unlikely to make much difference anyway ...
 
This involves a software package which is installed at many customers. The C&R was done to prevent the db from growing. Is there another way to prevent the db from growing?

Manual C&R is therefore not possible.
 
In other words, is there a way to prevent bloating of the files that are installed at a customer site, if no manual intervention is possible?

Thanks,
John
 
Manual C&R is therefore not possible.

Well, that's not true but I can understand where you are coming from. I don't like using compact and repair on close so I have a slightly different approach that I used before. I implemented a table where I kept track of the number of times the database was opened and then when it hit 10 times, it would then do a compact and repair on itself as it opened. I provided the user with a message that said it needed to perform a slight maintenance task and would close and reopen, which I then used my sendkeys code. But with Windows Vista and Windows 7 sendkeys can be unreliable (well, more unreliable than in previous versions). So, you could provide a maintenance db file which resides in the same folder as the application db and then have it do what I do with my auto updater code where it creates a batch file which executes, closes the database and it your case it would close itself, open the maintenance database which would run code from the autoexec macro which could use the code I have here (the one that doesn't involve sendkeys)
http://www.btabdevelopment.com/ts/default.aspx?PageId=38
and then the maintenance db could close itself. The batch file wouldn't necessarily need to close the main database as this couild be kicked off by the unload event of a hidden form which you would open when the main database is opened and then when the main database is closed it would kick off the batch file which could have a slight delay built in (like I do with my auto update code) to give it enough time to close before the maintenance db would be doing its thing.

So, hopefully that all made some sense.
 

Users who are viewing this thread

Back
Top Bottom