Click to See Complete Forum and Search --> : displaying images??


dhayes
04-04-2005, 10:44 AM
Hey guys i have an access database and an images folder stored on my testing server. I am storing the paths of the images in the access database
I have an asp page displaying the text from the database and i am just wonderin what the sql query might look like to display this image... Any help would be appreciated as i am very new to asp......

buntine
04-04-2005, 11:06 AM
We do this via HTML. The <img> element is used to display an image on the page. Your SQL need only grab the path of the file.

<img src="<%= imagePathFromDB %>" alt="An mouse-hover message" />

Regards.

phpnovice
04-04-2005, 11:10 AM
i am just wonderin what the sql query might look like to display this image...
The SQL query would be a normal SELECT to retrieve the path of the images -- nothing out of the ordinary. You cannot use SQL to retrieve the actual image because, I presume, the image is stored as a separate file. Yes?

After that, you have the choice of plugging the path into the SRC attribute of an HTML IMG tag, or using ADODB.Stream to retrieve the actual binary image content from the image file.