B
Bob Quintal
I have an application written in Access 2003 using linked
tables to SQL Server 2000. I need to code an Access form to
upload files (i.e. .pdf, .doc, .xls, .txt, etc.) to SQL Server
and I've never done this before. Can someone please point me
to some sample Access code that will take a file and save it
to the (SQL Server) database? I also need to know how to
retrieve it.
Thank you!
Please don't do that. Storing files in a table as a BLOB (Binary
Large OBject) is fraught with problems. Corruption is one,
slowness is another.
The workaround we have implemented is to parse the file to pull
the original file Drive:/path/name, the file extension, a
comments field, and store these into a simple table along with a
filename created from the primary key of the record.
Then we copy the file, using the new name to a specified
directory on a server. A command button on the form simply calls
the fHandleFile code available at
http://www.mvps.org/access/api/api0018.htm
much safer than using BLOBs