Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using image files outside the database

Status
Not open for further replies.

ChopinFan

Technical User
Oct 4, 2004
149
US
I posted this in another forum first, but perhaps this is a more appropriate place. I tried searching the FAQ and other posts for info on this, which I know people have dealt with before, but could find nothing. I need to be able to merge images (signatures) into reports, but I've heard that saving images in a SQL database isn't such a good idea. I've heard it's better to save images in a folder outside the database, then save the filepath in a table and pull the images using that filepath. How do I do this? Any helpful articles and instruction would be appreciated!
 
You can store images as blobs in the database, but that's what you've been cautioned to avoid. (That's a big topic in itself).

What you're describing requires secure disk space and just a database field like a big varchar. You'd store your signature on some machine -- say as \\server\restrictedfolder\signatures\SomeBodyImportant.jpg. Then, the entry in your database might show:

PersonKey PersonName Personstuff SignatureLocation
--------- ---------- ----------- -----------------
1 Mark Lee markinfo \\server\folder\sigs\marklee.jpg
2 Amy Smith AmyStuff \\server\folder\sigs\amysmith.jpg

Now, your report application needs to be able to locate and print the picture. If you're using Crystal Reports, older versions can use a third-party like cViewImage (discussed in the Crystal forums) and I think newer versions can actually directly access the picture from a file location, though you'd need to consult there to be sure.

Hope this helps,
Jen




 

Good info, thanks, but how do I actually pull the image? What would the code look like? I have an A2K3 front end.
 
What reporting tool are you using? Your 'code' will depend on that. Query Analyzer isn't going to display images! If Crystal, you can make the picture show up as the picture. If something else (like SQL Reporting Services), then someone else will have to answer that -- I'm not so familiar with other reporting tools. ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top