Generic Filepath on Network Drive

noboffinme

Registered User.
Local time
Today, 17:45
Joined
Nov 28, 2007
Messages
288
Hi

I have some modules that send Access Text to several Powerpoint presentation templates & I need to have all users be able to access these Powerpoint files.

In the code, I've set the path as a Network drive path "G:\FilepathName\Filename.ppt" etc but this won't work for other users as they will have named their drive perhaps differently for the drive letter "G" in this case, maybe calling theirs "R:\FilepathName\Filename.ppt".

Is it possible to include a hyperlink to replace the network drive path or should I get all users to change their drive letter to 'G'?

Thanks
 
You could try variations of: -

\\YOUR SERVER NAME\FilepathName\Filename.ppt
 
Thanks ChrisO

I'll give it a try tomorrow at work, have you tried this successfully yourself?
 
I’ve tested it under many different circumstances and it works fine.

You should be able to test it a home by substituting your computer name.

Example for linked BE: -

\\COB\C\Test\BE.mdb
 
The UNC path works fine. However it can be a pain if the data moves to another server for whatever reason.

At the very least include the location of the file as a Constant at the top of the procedure (or Module if used in multiple procedures, or as a Global constant if appropriate). This gets it down to one change and redistribution of the FE.

Another alternative is to store the path in a table in the backend database. One change and no redistribute required when these files move.

However I prefer the situation on a domain. Use Group Policy to limit UNC access to Admins only with others getting all mappings under the control of Group Policy. This ensures consistency and mapped drives work great.
 
Thanks ChrisO & GalaxiomatHome

GalaxiomatHome, if I used the option to enter the path in a table in the db, wouldn't I need to add the UNC path name & not the normal path "G:\...." etc as it would fail?

The db currently isn't split, it just sits on a shared Network Drive & if I add my path to the Powerpoint files, another user would get a 'Cannot locate file error", so I need a 'one size fits all' path for all users that have access to the drive.

I think ChrisO has the answer although I've never tried this method.

I do like the idea of storing the UNC path in a db table though.

Do you think storing the UNC path in a db table would achieve what I need?
 
Firstly, before you do anything else, split your database. It is a disaster waiting to happen in its current form. Splitting is not complex and takes very little time.

However I agree you certainly would not offer different paths for each user just because they use different mappings. Users should really come to some consistent mapping conventions.

Most of what I posted refers to best practice for working with UNC paths so they cause the least problems when they move.

In fact even when using a mapped drive it is a good idea to set the drive and path to constants. A drive and path somewhere way down in the code can be hard to spot as the problem.

I often use separate constants for ServerName and FilePath.
 
Thanks to both for your help!

It works fine, didn't know it was that easy, Cheers :)
 

Users who are viewing this thread

Back
Top Bottom