Do I need to use UNC?

S

salmonella

Thinking a little ahead, if I have a split db containing image controls where
the picture property is a path with drive names (e.g. c:/…..), will this
create a problem (images and BE) if I want to move the db to another drive on
another PC (not a network, etc)? If so, do I have to go to a UNC path
instead? (last if so) if so, is there an article someone can recomend on
doing this?

Thanks
 
R

Rick Brandt

salmonella said:
Thinking a little ahead, if I have a split db containing image
controls where the picture property is a path with drive names (e.g.
c:/...), will this create a problem (images and BE) if I want to move
the db to another drive on another PC (not a network, etc)? If so, do
I have to go to a UNC path instead? (last if so) if so, is there an
article someone can recomend on doing this?

Thanks

When you move the file to another PC are you going to copy the folder containing
the images as well (and place it in the same location) or do you want the app on
that PC to still use the images on your computer?

If the former, then you don't need a UNC path. If the latter then a UNC path
would be better. You do this by sharing the folder on your PC and then
referring to it with...

\\YourComputerName\ShareName

....instead of by drive letter.
 
S

salmonella

Rick,
What I would like to do is make the database as flexible as possible. I
would like it where everything (FE,BE, photos, etc) are in one folder and
that this folder could be moved to another PC (not connected to a network)
and the db work (i.e. links to BE and photos) independent of what drive it is
on, etc.

This is for academia and an example would be if I sent the DB with research
data to a collaborator in another country and he could just put the folder on
his computer and go.

I know that I cannot use drive paths but can I use UNC if it is a stand
alone PC?

Many Thanks
 
D

Douglas J Steele

A UNC is an absolute path to a specific location on a specific machine. That
doesn't sound like what you're looking for.

If you want to be able to move from one machine to another, what you need is
code to relink the tables, as opposed to using a UNC.

When your application starts up, determine where it exists (if you're using
Access 2000 or newer, you can use CurrentProject.Path for this information,
for Access 97 or earlier, you can use Left$(CurrentDb.Name,
Len(CurrentDb.Name) - Len(Dir$(CurrentDb.Name)))), then ensure that all the
tables are pointing to that same folder.

For the photos, you'd be best off using code that determines the folder as
above, and builds the full path by concatenating the file name to the folder
name, regardless of whether it's on your machine or not.
 
S

salmonella

thanks Doug,

I think I see where you are heading. I will give it some thought.

thanks again!
 
Top