Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open an External database while logging in to workgroup 1

Status
Not open for further replies.

rdmartin

Programmer
Dec 30, 2002
8
0
0
US
I am attempting to open a database exclusively, the databases in question are setup to login into a user group. I have found a way to open the databases using the OpenDatabase Method and the CurrentDB Method. However, I have not been able to incorporate a sign in or login script.
 
You're asking possibly two questions:
1. Can I open a database with a specific workgroup information file without using the command-line option?

A: Yes, first create the appropriate workspace and then a database under that workspace. Code:

Dim ws as Workspace
Dim db as Database
set ws = DBEngine.CreateWorkspace("location of .MDW file", "username", "password")
set db = ws.OpenDatabase 'etc

A2: You can open a database in exclusive mode with your current workgroup. Say you log into your database using your special shortcut and login. Close the database without closing Access. Now re-open the database using File->Open, and choose the "Exclusive Mode" option. This will open the db in exclusive mode, with the correct workgroup.

2. Can I open a database in exclusive-mode from the command line?


A: Yes. From the Access 97 help file:

/excl Opens the specified database for exclusive access. To open the database for shared access in a multiuser environment, omit this option.

So just add "/excl" to the end of your shortcut's command-line arguments.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top