Click to See Complete Forum and Search --> : How to display and OLE embedded picture


ColinV
August 25th, 2000, 01:51 PM
I have an Access '97 table (called Picture) which includes an embedded OLE object. The objects will point to bitmaps (.bmp) I have an ASP script in which I'd like to display the picture. The fields in the dataset are called Picture1, Picture2.... Is this possible?

The following code does not work:
...snip...
strQuery = "SELECT "
strQuery = strQuery & jobselection
strQuery = strQuery & " FROM ""Picture"" "

dim picture1, picture2, picture3, picture4, picture5, picture6

Set objRS = objConn.Execute(strQuery)
%>


<%
Response.Write objRs("Picture1")
...snip...

This is the error I get:

ADODB.Fields error '800a0cc1'

ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application.

/Kalen5/PictureAC.asp, line 43

Line 43 is the Response.Write line

Thanks

soar
August 25th, 2000, 02:48 PM
<%

response.Expires = 0
response.Buffer = TRUE
response.Clear

response.contenttype = "image/bmp"

'make your database connection
'Set rs = con.Execute("select picture1 from yourtable where whateverGoes4U...")

response.BinaryWrite rs("picture1")
response.End
%>

'Save this as myImageSource.asp

'Put this code inside your HTML page
<img src="myImageSource.asp" >