Solved

How to store a file in a SQL field

Posted on 2008-06-16
4
300 Views
Last Modified: 2013-11-27
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.
0
Comment
Question by:wsturdev
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:frankytee
ID: 21798911
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.
0
 
LVL 1

Author Comment

by:wsturdev
ID: 21802264
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?

0
 
LVL 19

Accepted Solution

by:
frankytee earned 500 total points
ID: 21811782
0
 
LVL 1

Author Closing Comment

by:wsturdev
ID: 31468496
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: http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_22440222.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.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question