PDA

View Full Version : [SOLVED:] Attach Files to Record



PeterJ
02-03-2007, 06:07 AM
Hey Group,

This is my second question to this forum. Your response to my last was prompt and helped a lot.

I was wondering if anyone had an example of attaching a file to a record.
I do not think that it can be directly attached to the database, but ...

I would like a file select button, that shows a file select dialog box so that the user could navigate to a file, select it and upload it to the database. I would assume that I would create a subdirectory under the location of the database that would be hidden. The function would copy the file to that location and add a path and filename to a field in the database. I would like to have multiple files be uploaded to the database for one record. I would also like eventually be able to put a viewer on the form to view these jpg, pdf, html and tif files that I am attaching.

I am sure that this has been done before...

Any help would be greatly appreciated. :)

PeterJ

OBP
02-03-2007, 08:26 AM
Peterj, yes you can locate files and attach them to records.
It is best to view jpg and tif files as OLE objects on a form.
If you want more than one file per record then they will have to be stored in a seperate table, which uses the Main Table's RecordID as it's link.
The files could then be shown as records on a Sub Form.
I have a database that finds and enters "file paths" in to a form's field.
If you Private Mail me your email address I will send you a copy, also of one that displays photo files, jpeg, gif types on a form or report.