Saving a File to SQL Server from Access 2003

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
 
R

richxyz via AccessMonster.com

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!
 

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