George R said:
Thank you for the information.
Instead of using Total Access Startup, could I elect to create a separate
front end DB for the one PC that needs to do the updates? If so, what lock
settings would I use on that copy and on the community copy?
"[MVP] S.Clark" wrote:
Hi George
Just to make sure I understand correctly - when you write:
"Multiple users open instances of the front end for simultaneous data
access"
I assume you mean that each user has his own copy of the front end (mdb or
mde file) on the local hard disk of his workstation, while the single shared
datasource is on a separate server. If so, this is good - the proper way to
do it.
Firstly we should establish whether all users really need to be out or not,
afterall, it is possible to batch update a table while others are using the
database without any conflict at all. For example, if you had a database
with a table of products which people were not constantly adding or
deleting, but had a field called Price which needed updating by increasing
all prices by 5%.
Set dbs=Currentdb
strSQL="UPDATE tblProduct SET Price = [Price]*1.05"
dbs.Execute strSQL,dbFailOnError
Msgbox CStr(dbs.RecordsAffected) & " record(s) updated"
Set dbs=Nothing
However, you might decide that you want to make sure that it is impossible
for anyone to view some cached version of the old price (say on some
combobox on a form). So on balance you might decide that you really do need
everyone to be out.
In general, though, you have no way of ensuring you have exclusive access to
the back end. But you can do some tricks - provided that everybody is
connecting to the back end via the front end which you designed. You can
have each front end asking every minute "does someone want to lock the
database?" This you would do by having a form which is constantly open (and
possibly hidden) grab a value from a field in a single-row table, eg.
tblDbInfo.ShutDown which is a yes/no field. You can then set this to 'yes'
and then wait while the front-ends start to realise that someone is
requesting a shut down. How the front-end applications react to this is
down to you, but they could flash or beep until the either the user shuts
down or the code does it for them. Then, once everyone has been kicked out,
you can open the database exclusively yourself with code like:
Set wks = DBEngine.CreateWorkspace("Jet", "Admin", "", dbUseJet)
Set dbs = wks.OpenDatabase("C:\Data\BackEnd.mdb", True)
If this works with no error, you can relax in the knowledge that everyone
else really is out and you can now make whatever changes you like.
.