Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image reference

Status
Not open for further replies.

janise

Technical User
May 25, 2003
161
US
As part of our cleanup effort, I am modifying our shopping cart program but have run into a little snag.

We store an image in our access db and reference it on our html file.

This is the current working one line syntax:

strHTML = strHTML & "<img src=" & q& "images/small/" & rs("cimageurl") &q& " align=" & q& "left"& q & ">" & vbcrlf

Of course is used for adding single quotes
q = chr(34)

Now I am creating a search page that will allow users to search by either product name or category name.
obviously it would make sense like the user requested to have the picture of the item show on the same page is the item description and price.

So far, I have been trying to duplicate the about reference to image but with no luck.

The image asks as though the path reference is wrong.
I see the shape of the image but not the image itself.
Please help.
Below is the code I have been playing with.

The code in red is the culprit.

sql="SELECT cname, cDescription, cPrice,cimageurl " &_
"FROM Products " &_
"WHERE catalogID=" & Product_Id
Set RS = DataConnection.Execute(sql)

Title = RS("cname")
Description = RS("cDescription")
cimage = RS("cImageurl")
Price = RS("cPrice")

<BODY>
<H1><%=Title%></H1>
<%=Description%><P>
[CODE = red]<img src="images/" & <%=cimage%> & " align=""left"">[/CODE]<P>
<%=Price%>
</BODY>
 
Try to replace with this line:

<img src="images/<%=cimage%>" align="left">


You're just having trouble because you're trying to use string concatnation (&) but HTML doesn't do that. The (&) would have to be between <% and %> tags so that the server knows to process the code first.

Did that makes sense? I hope it did.

 
thank you lovejaeeun!
You saved me, it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top