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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking workgroup file exclusively with db

Status
Not open for further replies.

jpcw

Technical User
Jun 20, 2002
34
GB
Hi,
I want to place a database application on a network drive which is accessible to people who all have Access installed on their machines, but perhaps in varying locations, and I want the database to be only opened using a workgroup file located in the same network folder. I know that you can use the /wrkgrp command line switch in a shortcut, but the problem with that is that a) the installation of Access may not be consistent across all users, b) the path to the network location of the db is long, and therefore the shortcut may run out of space (256 char limit), and c) if someone tries to open the db by double clicking, they'll just get an error when they get the password prompt because it'll refer to their own system mda file instead of the relevant workgroup file, and this will cause unnecssary calls to IT support!
Is there a way [there must be!] of making a database automatically reference a workgroup file exclusively (e.g. autoexec macro) without needing the kludgy command line approach (I'm sure many many people must have thought this and wanted the same, but I haven't found a solution)?
Help greatly appreciated.
 
Nope, no way to do that, actually.

A couple of thoughts:

You should probably move the database to something a lot closer to the root or map a drive for everyone that points directly to the directory with the database. Access often bogs down when you have to flow though a lot of directories to get to it. Weird, but very true.

I have used, in the past, a batch file that looks for different versions of Access. It's not exactly subtle, brilliant coding, but it seems to do the trick:
Code:
::Set a variable for the version file
set VerFile=CFL FE Version 1.2.txt

:MakeDirectories
::Make the directories (no harm if they're already there).
c:
cd\"Program Files"
mkdir ABCD
cd ABCD

:GetNewVersion
::Copy a new front end if the newest version file is not on the desktop PC.
if exist "%VerFile%" goto StartUp
copy "W:\CFL FE.mdb"
copy "W:\%VerFile%"

:StartUp
::Start up the database. Choose version depending on which is present 
if exist "C:\Program Files\Microsoft Office\Office10\MSAccess.exe" goto StartAXP

:StartAXP
"W:\Shortcut to CFL FE_XP.mdb.lnk"
goto ExitHere

:StartA2K
"W:\Shortcut to CFL FE_2k.mdb.lnk"

:ExitHere

Of course, it's quite possible to have Access installed anywhere on your machine, but at this client's office the only thing I was dealing with was different versions of Access.

Also, you'll notice that I'm not calling the database with the command line stuff here, I'm calling a shortcut. The reason is that if you open the database directly from this, the dos box will stay open until the database is closed. By opening the shortcut, the dos box closes right away (as the shortcut is only open for an instant.

Jeremy

---
Jeremy Wallace
METRIX Project Coordinator
Fund for the City of New York
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top