SQL Server - Storage of attachments

santosm
3StarLounger
Posts: 253
Joined: 19 Apr 2010, 09:01
Location: Indiana, USA

SQL Server - Storage of attachments

Post by santosm »

Hi All,
I am working with a SQL server backend for data now (access front end). What is the impact of storing pictures inside the SQL server data? I was thinking that it would be much better to store a link the files in question.

Thanks,
Mark
Thanks,
Mark

User avatar
HansV
Administrator
Posts: 78464
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SQL Server - Storage of attachments

Post by HansV »

It's better to store the path and filename of the pictures in a text field in your table.
On your Access form and/or report, you can use an Image control and set its Control Source to the name of the text field.

If you do store pictures in a Blob field in SQL Server, you'll still have to download each picture to a local drive to be able to display it in Access or otherwise, so that is not very efficient.
Best wishes,
Hans

santosm
3StarLounger
Posts: 253
Joined: 19 Apr 2010, 09:01
Location: Indiana, USA

Re: SQL Server - Storage of attachments

Post by santosm »

Hi Hans,
That is what I was thinking but wasn't sure how SQL server would treat these items. I did try it for giggles in Access a while back using that newer feature attachments. It bloated the DB terribly.

I can allow the user, via file dialog, to upload supported files like pics, spreadsheets, email messages, etc. and then make something in the front end to display the items that are "attached". I am thinking that I will make a folder that is linked to the record in the DB and then just stuff the files into that location. Have you ever done anything like this? If feasible, I want to stumble through it and learn!

Thanks,
Mark
Thanks,
Mark

User avatar
HansV
Administrator
Posts: 78464
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SQL Server - Storage of attachments

Post by HansV »

For images, see the last reply in the thread Linking a picture on a form. It demonstrates how you can display images on a form and report, and how to display a dialog to select picture files.

And the thread Hyperlink sub shows how to open arbitrary files from an Access database.
Best wishes,
Hans