Saving Attachments

K

kevin.hawkins

I recently received a request to save file attachments within a
database. I was able to call the windows dialog box to pick a file and
store it in an OLE field. This, of course, caused many problems. Then
I thought I would just take the path of the file and store it in the
table. This too caused troubles as the BE was on a server and the local
paths wouldn't work for other users. Needless to say I need a better
solution.

Is there any way to have a user select the file through the windows
dialog box and have Access copy the file to the network directory and
store the path? If so, what kind of issues could crop up? Any
assistance would be appreciated.

Thanks in advance.

Kevin T. Hawkins
 
J

John Nurick

Hi Kevin,

VBA has a FileCopy statement that can make a copy of a file, and a Name
statement that as well as renaming a file can move it to another drive
or folder.

If you're storing paths to files on servers, it's often a good idea to
store the path in UNC format (e.g. \\SERVER\Share\Folder\File.ext)
rather than using a mapped drive letter (e.g. H:\Folder\File.ext); this
avoids problems with different workstations using different drive
letters for the same shares.

(FWIW there's code at http://support.microsoft.com/?kbid=210050 that
returns the UNC path associated with a mapped drive letter.)
 

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