Compacting db

superrob5

Registered User.
Local time
Today, 22:14
Joined
May 8, 2003
Messages
99
I know there are benefits to compacting an Access MDB file. What are there except for saving space????



Rob
 
I see. I have a questoin. I have a db that is on a network and would like to compact. Is it best to automate and if so is there a way to automate them when noone is on the db. Is there a way to test to see if the db is opened on another computer. But I guess the safe way is to wait til the evening and do compacts manually???

Rob
 
To automate, you got to make sure no one as left office with the db open. (There is thread about how to disconect users in this forum...)

Then, create a task which opens the disconnection script and a vbscript at midnight with something like this: (Not sure of the syntax thaugh...)
Code:
Shell.Run """" & AccessPath _ & """ """ & SourceFolder & "\" & ProgramFile _ & """ /wrkgrp """ & SourceFolder & "\" & SecurityPath _ & """ /compact /user """ & Username _ & """ /pwd """ & Password & """", 3, True

With the mdb file, you'll see a ldb file when someone is connected.
Opening it with notepad will even show you who has visited the db. (Not actualy on it, but has visited) The ldb file disapears when every one has log off.

It may sound a bit complicated (It is!), but that's all I can tell you now. I've done it with the help of other members of this forum. Search thru it and you shall find more answers.
Good luck!
 

Users who are viewing this thread

Back
Top Bottom