Solved

Retrieve image with sql statement based on filename

Posted on 2001-06-06
8
209 Views
Last Modified: 2008-07-03
I have a (sql server) database with a table containing logo files of companies. For a better performance only the filename is saved to the table (so it is not a BLOB field). All image files are in the same directory. For example the path is "e:\images" and the filename is in field strPictureLogo of tblCompany. Is it possible to build a sql statement that retrieves the image files, so that the view contains the images?
0
Comment
Question by:Sebina
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6158798
i would say no...
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 6158827
Do you mean you want the images or just the full path:
If the latter:


select 'e:\images\' + strpicturelogo as logopath
from tblcompany

Cheers.
0
 

Author Comment

by:Sebina
ID: 6159600
I do not mean the full path! I would like to have the image in a view as if the image was in the database.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6159633
I know that Access has this feature, but SQL Server doesn't ...
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 6159711
I agree with Angelll
Out interest, what client do you want to run this SQL/view from?
0
 

Author Comment

by:Sebina
ID: 6159792
I want the images to appear on a Crystal Report which is opened from ASP (in a web application).
Since it is not possible to change the path of an image when opening the Crystal Report from ASP (though this is possible from a VB application) I need the images to be included in a view.

Thanks for your comments.
0
 
LVL 2

Accepted Solution

by:
niklausj earned 100 total points
ID: 6160955
in sql 2000 you could write a UDF to pull the File into a temporary blob in sql and include it into a view, but that'll give you a performance far below any blob field natively in the db.
But depending on your needs you can speed up blob stuff if you insert the blobs in a separate table in a different filegroup that you can have in a different file on a different drive.
( Go to DB Properties, Add a DataFile give it a Different FileGroupName, then create table (ID int, Blob image ) on yourFileGroup to send the table to this file)
0
 

Author Comment

by:Sebina
ID: 6244061
So it just seems not possible to add pictures to a view without having the pictures in a (temporary) table. I now have simply saved the pictures to a table directly. Thanks for your help.

Sebina
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Insert to Begin if data exists 2 33
SQL Pivot with row total 5 30
SQL Quer 4 22
How to use spatial data types in SQL Server Database project 2 24
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

830 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