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!

Can I check on DB open to see which drive copy is being used? 1

Status
Not open for further replies.

MacroScope

Programmer
Jul 17, 2010
286
0
0
US
I have a network of 20 users with Access 2007 and SQL Server 2012 back end. There's one central copy of the front end on our public drive (P:\), and a login script for each user. As they log in, it automatically updates their C:\ copy from the P:\ copy, so everyone is always using the most current version.

The problem is that occasionally someone opens and runs the P:\ copy on their desktop. Of course, they're completely unaware that they're on the wrong drive, but I can't write over the public copy to provide updates as long as it's open, and the updates that it may have are not going out to others while it's in use.

Is there some way as the user starts to open the database I can look to see if the copy they're opening is on the P:\ drive, and if so warn the user? I don't want to stop it from being opened, but just alert the user and maybe give them the option of continuing or closing (and preferably automatically opening the correct copy).

It's a giant pain when that copy is inadvertently opened and someone has to go around and check every machine to find the culprit.

Thanks in advance for your help.
 
How do your users start your app? I would assume they have a shortcut somewhere where they click. In my opinion, they shouldn't even know where the main copy is, and be able to only start your app from their local copy on C:\ drive.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Normally they open Access, and the last database copy opened is at the top of the list. I may have worked on their computer and was last in the P: drive. It may have been opened on their station or they may not choose the correct copy from the list.

I'd just like a fail-safe way of determining which drive the copy they're opening is on and popping a warning if it's wrong if possible.
 
Did you try to test the value of Application.CurrentProject.Path ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You've saved me again, PHV. I was unaware of Application.CurrentProject.Path. This definitely solves my problem.

I still owe you a beer! Maybe two!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top