KICK OF USER

  • Thread starter Thread starter lilbit27
  • Start date Start date
L

lilbit27

Hello,

does anyone know of a code that can kick ALL user's out of a database.
I need code for a database that does not have and backend.
 
This is not going to work well for an application that does not have a back
end. You are asking for corruption by not having a back end. Don't bother
to post any excues or why you have to do it this way, there are none.

But, that being said. Here is what you can do. You will need a form that is
always open in your application. It can be hidden. Set a timer for the form
and in the timer event, check a field in a table for a specific value. You
could have a one field, one record table. The first time it finds a specific
value in the field, present a message box to the user telling them the app
will be closing in 5 minutes (or however long you want to give them to finish
up). Then set a count down variable in the timer event so that it will
increment every time the timer event fires after it frst finds the close
value. When the varialbe hits a certain value, DoCmd.Quit.

Now, the problem is it will kick everyone out, even you, so you will have to
have a way to avoid kicking yourself out.

Now to make it happen, in the Load event of the form I described, have it
set the close down field to Null, or any other vaule than the one that makes
the close countdown start. When you want everyone out, you will have to open
that table, put the value in it that tells the timer to start counting down.

You really need to split your application into Front and Back ends. As I
stated previously, there is no valid reason not to, but many, many reasons
you should, particularly if it is multi user. First there is the corruption
problem, it will happen sooner or later. And when you split:

Perf romance will improve. Particularly if you do it correctly and install
a copy of the front end on each user's computer. Even multiple users sharing
a front end is in serious danger of corruption. Multiple users sharing even
a front end doubles network traffic.

Modification will be much easier. Right now, you probably have to get
everybody out of the database so you can import changes from your development
copy. (a good bet this is what is prompting your question) Updating your
front ends for each user is not that big a problem. If you look on this site
and search some of the many web sites covering Access issues, you will find
several utilities that will automatically copy new versions to your users'
computers automatically. You will only have to do frequent back ups of the
data rather than the entire application.
 
lilbit27 said:
Hello,

does anyone know of a code that can kick ALL user's out of a database.
I need code for a database that does not have and backend.

This code will work on any database:

http://www.datastrat.com/Download/KickEm.zip

WARNING: It is extremely important to run all multi-user databases with both
front-ends running on each workstation, and a back-end running on the
server. The code above will work for all users in a single database, but I
can guarantee you that you will eventually corrupt the database irreparably.
If one user is in the middle of a database write when another closes it
down, you are finished, done, caput. Even if you get away with it a few
times, it won't take long to corrupt it. You've been warned.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top