hey, i was buzzing the newsgroups and i can give you the code for it
its no worries, i store images in an access dbase as well using ole objec
and pull it out displaying it on the page just fine. I'm using VBScript to do it, so
i don't know about your environment, but this should help you get on the right track
Use the getimage.asp to pull the images from showimage.as
You're passing a query to the showimage.asp file which renders the image from th
Access Dbase and displays it on the getimage.asp page using the Primary Ke
from the Imagetable in the dbase you're using
I hope this helps. If you can help me figure out how to replace the OLE Object imag
from the field that would be great. i'm having issues w/ that, it doesn't want to overwrit
the image, yet it won't throw me any errors to start figuring out how to do it
incidently, if a person tries to save the image, it will save as 'showimage.asp' and open i
a text editor in binary. they'd have to know to rename it to the proper file extension of the
image itself.
I've tested this w/ png,jpg,gif and it works fine for my purposes.
cheers
James Mendha
Brave Pixel Media Cor
Vancouver, BC
(E-Mail Removed)
<text listed below:
getimage.asp
<
'declare some job
Dim Conn, objRS, SQ
SQL = "SELECT * FROM <TableName> order by id desc
Set Conn = Server.CreateObject("ADODB.Connection"
'ms access dsnless connectio
dim db_connec
db_connect="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<driveletter>:/<path-to-database>/<ImageDatabase>.mdb
Conn.Open db_connec
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open SQL, Con
%><html><HEAD><TITLE>showphoto</TITLE></HEAD><body bgcolor="#ffffff"><table cellpadding="2" cellspacing="2" border="0" width="90%"><tbody><% do while not RS.EOF %><tr valign="Top"><td valign="Top"><img src="showimage.asp?ID=<%= objRS("ID")%>" width="<%objRS("ImageWidth")%>" border="0"></td></tr><%
RS.MoveNex
Loop
%></table></body></html><
'Clean up..
objRS.Clos
Set objRS = Nothin
Conn.Clos
Set Conn = Nothin
%
showimage.as
<
dim db_connec
db_connect="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/webserver/databases/PhaseMechanic.mdb
%><
REM Step 1: Read in ID from querystring in file get.as
Dim I
ID = Request.QueryString("ID"
REM Step 2: select picture from ms acces
Dim Conn, RS, SQ
SQL = "SELECT <ImageField> FROM <tableName> WHERE ImagetID = " & I
REM step 3: make a dbase connectio
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open db_connec
Set RS = Server.CreateObject("ADODB.Recordset"
RS.Open SQL, Con
REM Step 4: Set the ContentType to image/jp
Response.ContentType = "image/jpg
REM Step 5: Use Response.BinaryWrite to output the imag
Response.BinaryWrite RS("ImageData"
RS.Clos
Set RS = Nothin
Conn.Clos
Set Conn = Nothin
%>