So, We have a shared (company wide) drive at work and located in it we
have
an Access database to keep some of our information. Here is what I would
like to know. When another co-worker in the database a icon of the same
database with a lock over it is shown. What does this mean???
Actually when the first user goes into the database file and opens it up,
access will opens up what's called a "access locking" file. If you look
closely at the file extension you'll notice it is .ldb (so it has the same
name as the database, but a different file extension).
This is a temporary file that disappears when the last user access to out of
the database. The purpose of this file is to allow multi user operation of
the application when more than one user works on (opens) the database. It is
this locking file that keeps track of one user adding a record, and if
another user opens the database, this is how MS access will keep track if
two users try to edit the same record.
You'll find it interesting that we often see posts in this newsgroup about
how only ONE access user can open up the data file. Often this is because
users don't have create and delete file permissions in the actual location
(folder) of where the data file is. If upon opening the actual backend
database if the user can not create that temp locking work file, MS access
will actually put the application into single user mode and will not permit
additional users to edit that data. (so the customer finds that one user can
open it and close it, they find another user can open and close it, but if
they both try to open the data file the same time, they find the second
person can not get in. -- This is usually due to the fact that the locking
file can't be created. So keep in mind that all users need actually full
permissions to that database directory where the data resides, and that
includes file creation rights (so that MS access can create that locking
filed when the first person opens the database).
As mentioned when the last user exits of database file, you should see that
locking file disappear (assuming that users have delete permissions to the
folder where that data file resides).
Also, What if someone is in the database and...
-I enter info. and save it. Will the database contain the information
the
next time I or someone else opens it?
-I enter info. and someone else enters info and saves it. WIll the
database
contain both info, providing they are entering different information?
Yes for the most part two users can go to edit data in the same file it the
same time, and when they navagate to anohter reocrd, or close the form, or
exit..the data is saved back to the hard disk.
WHat
if they enter the same information but different data? I.E. they both
enter
the same transaction but they use different amounts?
Why not try the above? Simply launch MS access, **then** open your database,
and then go to a record and start editing it (dont close the form, or move
to another reocrd). Now, launch MS access again, **then** open the same
database, and then go to the same record and start editing that same reocrd.
The result will simulate EXACLTY the same as if two different users were
ediiting the database.
What happens in this case is the second user will get a warning message
about the fact that the records been edited by someone else, and do they
want a save their data, if they say yes they going to overwrite the previous
users data. This does not happen very often, but if you have an application
with quite a few users and the possibility of two users who editing the same
record at the same time is going to occur frequently, then you can change
the setting in the forms data tab to lock that given record, and when you
use this setting then ONLY one user can edit the record at a given time (the
second user will be be able to view the record at a given point in time, but
they'll be prevented from actually editing or typeing in the form to modiy
the record).
Keep in mind while you can allow multiple uses into the applicaton at the
same time, it is a recommended practice that you SPLIT the application. This
split idea allows you to install the application part on each machine and
then that of the back end data file part resides on the shared folder.
I explain this concept of splitting here, and you don't have to change your
code etc., but you really need split your database for issues of stability.
http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm