Re: Allow exclusive access only



Thanks Ben,

I give the first method a try...


"Ben Silvert" <BenSilvert@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BB3AF8CE-7ABE-4E33-9EB8-E91B9FA0CC15@xxxxxxxxxxxxxxxx
One way to do this would be to append a row into a table in the database
that
would keep track of who has opened the database. That code would be
triggered
when the startup form is opened. If there already was a name in the table,
then the application would let the user know who has the database open,
and
then close.

The unload event of the startup form should remove the name of the user
from
the table.

You may want to keep the date of when the user logged into the database in
that table as well; someone may leave the database open and go home
without
closing the database. It gets a little sticky here. If the date is older
than
a day, maybe delete the old log record and let the new person in.

A problem with the solution is that a user could open the database with
the
shift key down. You should disable that from happening.

Method 2.

Another way to do this would be to write the name of the logged in user to
a
file. Anybody else that opens the database first reads the file, if it
exists. The database then closes if the file exists. Then what you could
do
is have the users not open the database directly, but run a vbscript file
that would check for the existence of the user log file first. If there
were
none, then the script would make and write to the file, and open the
database. When the database closes, it would delete the file.

Hope this helped.

"Rob" wrote:

Is there a programatic way to allow only 1 user at a time to exclusively
open an mdb ?

Example: If someone else is using the mdb, then give the new user, who
is
attempting to open the mdb, a message stating that ... "Fred is
currently
using the db" ?





.



Relevant Pages

  • Re: Tracking Log In and Log Out times of Users
    ... The fact that the database is on the server should be irrelevant. ... Type mismatch and then highlights Set rst = ... On my startup form, (that opens every time the database is open, ... I then went to the load ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... The autoexec macro opens a ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ... I'm quite certain that you can't Compact an open database from within itself ...
    (microsoft.public.access.modulesdaovba)
  • Re: Code causes error 2486 in access 2000, IPF in 2002
    ... Compact the database to get rid of this junk: ... Allen Browne - Microsoft MVP. ... Windows 98 machine. ... update queries and opens another form - ...
    (microsoft.public.access.formscoding)
  • Re: Database set up help
    ... let's see...I choose the y/n data type because I am using ... User opens up form and enters Employee Information in the fields ... 2 of the 38 options in my main menu are BPCS Applications ... I set up a database with this so far: ...
    (microsoft.public.access.gettingstarted)
  • Re: security wizard cannot be run
    ... You need to open your database using your secured mdw (i.e. the desktop ... Open Access (not via the shortcut). ... Create a new mdb and import everything from your 'secure' mdb. ... Once the database opens, the ...
    (microsoft.public.access.security)