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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative Path(?)

Status
Not open for further replies.

LadyDev

Programmer
Jan 29, 2003
86
0
0
US
I am not sure of the terminology, but how do you 'create relative paths' for pictures in a database. Presently I have the full path (c:\my\picture\you.jpg) to the image stored in a text field within the db, but when I distribute the .mdb to others I have (or they have) to change the directory to reflect their system.

So how can I set up any .mdb so that I can store just the (you.jpg) in the db and when I pass it to someone else I don't have to spend an hour or two changing paths?

Thanks!
 
Check out the CurDir function in help, that should solve the problem...not too tough. Hope that helps.

Kevin
 
Actually, CurDir gets the current path, not the path to the directory in which the database is stored. To get the path to the database, use currentdb.name. You'll have to parse out the actual name of the database.

On the other hand, it would probably be a lot easier for the users if you gave them a chance to enter the path to the directory where their pictures are. You can make a table to store it, so you can always get to it, or just store it in a field in a form the never gets closed (though it's ok if it gets hidden).

If you go that route, get code for the common file dialog. I know it's in the Access [version number] Developer's Handbook.

Hope this helps.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top