0

I have been trying to make images appear in a table from a database i have created in MS Access this code

<td><%=(Recordset1.Fields.Item("Image").Value)%></td>

is the code that is original used that shows the path, i was told to replace the code with the one below the original but i seem to be getting an error in the table:

<td><IMG SRC = "Images/<%=(Recordset1.Image)%>"></td>

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Image'


Any ideas on how to make the image appear?
Thanks

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by AceDesignz
0

You were almost right the first time...

<IMG SRC = "Images/<%= Recordset1.Fields.Item("Image").Value %>">

or...

strImage = Recordset1.Fields.Item("Image").Value

response.write"<IMG SRC=""Images/" & strImage & """>"

Edited by ArtistScope: n/a

0

I have been trying to make images appear in a table from a database i have created in MS Access this code

<td><%=(Recordset1.Fields.Item("Image").Value)%></td>

is the code that is original used that shows the path, i was told to replace the code with the one below the original but i seem to be getting an error in the table:

<td><IMG SRC = "Images/<%=(Recordset1.Image)%>"></td>

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Image'


Any ideas on how to make the image appear?
Thanks

Hi, if the image is already stored in the database table, then i would be in binary format. You would have to output the contenttype and image data field in order for the image to be seen.

Response.ContentType = RecordSet("[ContentType]");
Response.BinaryWrite(RecordSet("[binary Image Field]"));

If the image stored in the table is only a path then you would output it regularly.

Response.Write("<img src='"+RecordSet(image filed)+"'/>");

or

<img src="<%=[RecordSet(image field)]%>"

I use Javascript, so a little tweaking my be needed if using VBscript.

Edited by AceDesignz: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.