How to open Backend MDB Exclusively

J

John Moore

I have an Acc97 product distributed as a FE/BE in a runtime
environment. I have each MDB designed as shared since the product is
designed to work over a network and everything works fine.

However, I would like, under very specific circumstances, to have the
backend MDB open exclusively so that only one user at a time can get
access. Is it possible to set the backend to run exclusively from the
FRONTEND MDB using VBA code or some other technique?

Any and all help is appreciated.

TC
 
J

Jon Ley

John,

You can use the OpenDatabase method of a Workspace object to achieve this. I
assume that you're using DAO?:

Dim WS As Workspace
Dim DB as Database
Set WS = DBEngine(0)
Set DB = WS.OpenDatabase("BackEnd.mdb", True)

If you're using a secured database and need to use a different login to open
the backend with full permissions, you would need to replace the Set WS
statement with

Set WS = DBEngine.CreateWorkspace("Secure", strAdminUser, strAdminPwd)

Don't forget to close and release all object variables when you've finished
with them

DB.Close
Set DB = Nothing
Set WS = Nothing

Jon.
 
D

david epsom dot com dot au

You can create exclusive links if you use code to create
the links instead of using the Link Manager. You would
have to re-link to switch between exclusive links and
shared links.

using CreateTableDef to create the links, the option
is dao.dbAttachExclusive

(david)
 

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