seek a picture file in application directory

C

Cesar

I developed an Access 2003 application with a company logo in wmf format in
forms and reports.
I coded a public string containing the full path and the file name for this
image that I saved in the same directory used for developing the application.
Is there a way to deploy the application without having to hard code this
line telling Access to look for this image in the same directory the
application is installed, either in a local single user or network
environment?
Tried the Dir fucntion but it takes me to My documents.
Any ideas?
 
D

Douglas J. Steele

To know the folder where the front-end's located, use

Application.CurrentProject.Path
 
K

Klatuu

Currentdb.Name will return the path and name of the database.
BTW, an Access application should not be deployed on a network drive. Only
the back end database should.
 
C

Cesar

Application.CurrentProject.Path & "\Name of Picture.wmf"

worked well for the picture but your recommendation (that I like a lot) to
install the data tables on the network takes me back to square 1. How do I
tell the front end to look for the data tables in a network drive?
Another alternative is to place the tables in ShareService. Is there a way?
Thanks,
 
K

Klatuu

The back end mdb (data tables and relationships only) should be put on a
network drive to which all users have read/write/delete permissions. For
optimum performance, the share name should be as close to the root as
possible and your mdb name should be limited to 8 characters.

Each user should have a copy of the front end (forms, reports, macros,
modules) on their desktop. You can use the Linked Table manager to link to
the back end mdb. Now, one thing to be aware of is that often not all users
will have the same drive mapping. For example, you may have the path mapped
as your M: drive and another may have it mapped as the R: drive. Using Drive
map paths, this will cause a problem when you distribute your application.
The better approach is to use UNC paths. That is, instead of:
M:\AccessApp\
You would use:
\\ServerName\Access\Apps

Here is a link to a site that has an API call that will convert drive maps
to UNC paths.
What I usually do is map the drives using the UNC path in development,
create an mde file, and distribute the mde already mapped to the users. That
way, it doesn't matter how their drives are mapped. It is, in fact, not a
bad idea to have the back end in a location that the users don't have a drive
map to. That is one way to avoid anyone messing with the files in the back
end folder.

Sometimes, it may be necessary to include in your application code that will
test and relink the back end tables.

http://www.mvps.org/access/api/api0003.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top