Couple of ways of doing this:
1. Content Type and Binary Write
Create a file called getPic.asp. This file will be ASP code only (no HTML) and will need to set the contenttype to image/jpeg (or whatever the format is). The page should accept a value in the querystring to represent the id of the image you want to use (e.g. the guid of the row, or other unique id)
The code then needs to get the image data from the database - don't use ODBC if you can help it (
- for DSN-less connections) and pull back ONLY the image data from the database. You can either use GetRows (which will pull the whole blob data in one go, but will usually circumnavigate BLOB retrieval issues, or you can use GetChunk method of the recordset object.
Then use BinaryWrite to output the binary data of the image. This is the only data you want to output in this page. So whenever you call getPic.asp it will respond with an image. Your code to show a picture in your html page would look something like:
[tt]<img src="/dir/path/getPic.asp?id=123" alt="example" />[/tt]
This will allow you to show picture data from the database inside any page you want.
2. Export to File Based Images
The easiest and most common way is to use files from the OS for images, and just store the links to the files in the db. If you wanted you could run a one time process to export all of these images to the OS. You can use the above method, and just replace the output to the page with the filesystemobject, as long as you record the location/name of the file in the source db. This will mean you can use the simpler route of file based images rather than db based.
Hope that helps,
A smile is worth a thousand kind words. So smile, it's easy! 