Close Database

K

katz

Hello All,

How can I kick out everybody from the database. I waste so much time running
around to close the database.
Also is there a way to compact the database while its open?
Thanks
Abe
 
D

Douglas J. Steele

Jeff Conrad has a number of options listed at
http://www.accessmvp.com/JConrad/accessjunkie/kickoff.html

You need exclusive access to the database to compact it. You can initiate
the compact from within an open database (see, for example,
http://www.mvps.org/access/general/gen0041.htm at "The Access Web"), but as
far as I know, doing the compact will close it.

Out of curiosity, why do you need to kick everybody from the database? Are
you talking about after hours so that you can compact and backup, or are you
trying to make changes to the application during the day? Is your
application split into a front-end (containing the queries, forms, reports,
macros and modules) linked to a back-end (containing the tables and
relationships) like it should be?
 
K

Klatuu

Kicking everyone out takes a bit of coding, but is doable.
First, you need to have a form that opens on startup and stays open until
the database is closed. It can be hidden.
This form needs a time event. I'll describe that later.
Next, you need to add a table to the back end. I suggest two fields.
tblKickOff
LOG_OFF_FLAG - Boolean
LOG_OFF_DESCR - Text 30

Now, back to the front end. when the form's timer fires check value of
LOG_OFF_FLAG. If it is true, present a message box to the user using
LOG_OFF_DESCR as the text so the user knows the application will coming down
soon. I also give them 5 minutes and set my timer interval to one minute and
count it down with a message box every minute with the option to close now.
Here is an opportunity to learn how to use a Static variable to keep track of
the number of minutes left.

Also, put some logic in your startup routine so they can't open the front
end if the flag is True.

The adminstartor will need a way to open the backend so he can change the
flag and the text.
 
K

katz

Thanks Douglas for your quick response.
Many times I want to do changes during the day. If I have allot of changes,
I want to replace the database, for minor changes I want to do on the fly,
but with acc2003 you cant do any changes while the db is open by anybody.
With Acc97 I was able to do minor changes, even the db was open.
I don't know why Microsoft took away this option.
Also acc97 is more stable, with acc2003 I have a lot complains and problems
with corruptions.
Yes all my databases are split into two.
Thanks again
Abe
 
K

katz

Thanks Dave for your quick response.
Will this code work if the db is open but is minimized and not used?
Thanks again
Abe
 
D

Douglas J. Steele

It sounds as though while your database is split, everyone's using the same
front-end. Each user should have his/her own copy of the front-end,
preferably on his/her hard drive. With that set up, you can make changes to
your heart's content on your machine, pushing the new version out once
you're satisfied.

To ensure that each user has the correct version of the front-end, check out
the free Auto FE Updater Tony Toews has at
http://www.granite.ab.ca/access/autofe.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top