Link to home
Start Free TrialLog in
Avatar of wsturdev
wsturdevFlag for United States of America

asked on

How to store a file in a SQL field

I have an Access 2003 Front End that connects to a SQL Server 2005 Back End.  I need to select documents from a local PC and store them in a table in SQL Server.  At a later time, I will retrieve them and reconstitute them on a local PC.  The files can be of any type (Excel, Word, Viseo, PowerPoint, etc.).  I have no interest in looking at the data inside them, just in storing them and retrieving them.

What type of field would I use in SQL Server, and what code would I use in Access to read in the file and transmit it to SQL Server?  Assume I already have the filepath to the document.
Avatar of frankytee
frankytee
Flag of Australia image

why store the files in your sql server? just put them in whatever folders in your server and then put the filepath and file name in  a sql table so you can reference them.
Avatar of wsturdev

ASKER

In my app, the User composes an email.  He decides whether to include an attachment or not.  The attachment is on his PC.  He selects the attachment document.  It can be in any format (Excel, Word, PowerPoint, PDF, JPEG, MPEG, Text, you name it).

How do I, programmatically within Access, take that document from his PC and move it to the server to a predefined location?

ASKER CERTIFIED SOLUTION
Avatar of frankytee
frankytee
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
WOW...  I really am getting too old for this stuff.  My memory is really failing me!  I just cannot wait to retire!

I asked this same question in March of 2007 and got the answer I needed: https://www.experts-exchange.com/questions/22440222/How-can-I-make-an-HTML-file-appear-in-the-Body-of-an-Outlook-Message-when-I-automate-it-from-Access.html?sfQueryTermInfo=1+function+readfil+strfile+string

I apologize for posting a "duplicate" question.  Your response, however, did lead me to learn something, so for that reason, I am giving you the points.