Joe4
MrExcel MVP, Junior Admin
- Joined
- Aug 1, 2002
- Messages
- 74,084
- Office Version
- 365
- Platform
- Windows
I volunteer at an organization that has a situation much like this one here: http://www.accessmonster.com/Uwe/Fo...rrentProject-Path-and-CurrentProject-FullName
Basically, they have a network of three PCs hooked up to each other, with Access databases on each one that they all link to (I tried to sell them on the idea of splitting the databases and having separate front ends, but they did not like that as they all want to be able to add queries that everyone can acces). The problem is that occassionally, somehow a database will be copied, and users will be updating different copies of the database (instead of updating the same one). I thought a way to help prevent that is institute code like in the link above, where upon opening it verifies the location and name of the database.
However, just like one of the replies in that link states, I am finding that if the database resides on the computer that is opening it, it returns a local file path. However, if a computer opens a database found on some other computer of the network, it returns a UNC file path. In order to get the code to work properly every single time, I would need it to return the UNC file path in every instance.
One of the replies in the link contains this link (http://www.mvps.org/access/api/api0003.htm) to some code that is supposed to be able to return the UNC file path of any mapped drive. However, I cannot get it to work for me, as it returns compiler errors with the "Private Declare Function" statements. It appears that this is because I am using Microsoft Access 2010 on a 64 bit system of Windows 7.
Does anyone know how I can get the UNC file path of a database (or mapped drive) using Access 2000 on a 64 bit system?
Or does anyone have any other clever ideas to help prevent users from working in "accidental" copies of a database?
Thanks
Basically, they have a network of three PCs hooked up to each other, with Access databases on each one that they all link to (I tried to sell them on the idea of splitting the databases and having separate front ends, but they did not like that as they all want to be able to add queries that everyone can acces). The problem is that occassionally, somehow a database will be copied, and users will be updating different copies of the database (instead of updating the same one). I thought a way to help prevent that is institute code like in the link above, where upon opening it verifies the location and name of the database.
However, just like one of the replies in that link states, I am finding that if the database resides on the computer that is opening it, it returns a local file path. However, if a computer opens a database found on some other computer of the network, it returns a UNC file path. In order to get the code to work properly every single time, I would need it to return the UNC file path in every instance.
One of the replies in the link contains this link (http://www.mvps.org/access/api/api0003.htm) to some code that is supposed to be able to return the UNC file path of any mapped drive. However, I cannot get it to work for me, as it returns compiler errors with the "Private Declare Function" statements. It appears that this is because I am using Microsoft Access 2010 on a 64 bit system of Windows 7.
Does anyone know how I can get the UNC file path of a database (or mapped drive) using Access 2000 on a 64 bit system?
Or does anyone have any other clever ideas to help prevent users from working in "accidental" copies of a database?
Thanks