Solved

How to store a file in a SQL field

Posted on 2008-06-16
4
273 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now