File path

mongaro

Registered User.
Local time
Today, 04:14
Joined
Sep 14, 2005
Messages
10
Hello, I have a simple db with a table containing a list of pdf documents and with a field with the Hyperlink to open every single documents.
The problem is that when our IT people change the configuration of our servers, I must modify every single Hyperlink to continue to work.
Someone of you can give me a solution to avoid this problem ( i.e. if I can set a folder by VBA).
Many thanks to all!
 
Hum...

Maybe you could do 'system variables' type table where you can store these types of values. In this case the table could have an identifier fld and a value fld. So for the path that changes, a record in this table could store 'serverPath' as the indentifier and maybe "f:\myfolder\myFolder" as the value.

So...

To get to entire file/path you dlookup() the path and concatenate it with the filename from the table. Now, whenever the path changes, all you need to do is change the path in the system table...

Make sense?
 
if the db is in the same folder as the other files (or the files are in a subfolder of the folder the db is kept in), you could also use the currentdb attributes to get it accurate every time, no changes neccesarry (as long as the db name stays constant)

Dim dbname as string, firstpath as string
dbname = <set to the db name here, including the .mdb extension>
firstpath = Left(CurrentDb.Name, Instr(1, CurrentDb.name, dbname))

then just concatenate the firstpath onto the rest of the relative path names to produce the full path.
 
Quote: store 'serverPath' as the indentifier and maybe "f:\myfolder\myFolder" as the value

I tend to use this method for my connection strings etc to my data source. I don't use a table though as it is subject to dabbling fingers. I use the declarations section of a module and hard code the connections, paths etc as constants.

As I distribute apps as MDE files my pats are protected.
 

Users who are viewing this thread

Back
Top Bottom