Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2004
    Posts
    6

    Unanswered: diplaying images in asp

    I am attempting to display images from a folder in a directory but the image must be associated with the product id. I get an image place holder when i run my code and the place holder contain the correct image id but there is no image. i have pasted the code below. anyhelp would be greatly appreciated.

    <%@ Language=VBScript %>
    <%

    Dim Conn, RS, sSQL, objCmd


    Set Conn = CreateObject("ADODB.Connection")
    Conn.Open Application("Conn_ConnectionString")

    Set objCmd=Server.CreateObject("ADODB.Command")
    objCmd.ActiveConnection=Conn
    sSQL = " Select ProductNumber, Image, Name, Manufacturer from CATALOG_PRODUCTS where left(ProductNumber,2) = '01' "
    Set RS = Conn.execute(sSQL)

    %>
    <% response.write("<Table border=1 bordercolor=black width='100%'><tr><th width='7%'><font size='1'>Product Number</font></th>")%>
    <% response.write("<th width='25%'><font size='1'>Name</font></th>")%>
    <% response.write("<th width='25%'><font size='1'>Product Image</font></th>")%>
    <% response.write("<th width='25%'><font size='1'>Manufacturer</font></th>")%>
    <% response.write("</th></tr></table>")%>
    <%Do While Not rs.EOF %>

    <% response.write("<Table border=0 width='100%'><tr><td width='10%'><font size='1'>")%> <%=rs("ProductNumber")%>
    <% response.write("</td><td width='25%'><font size='1'>")%><%=rs("Name")%>

    <%Response.Write "</td><td width='25%' align=center><img src=""catalog_imgs?Image=" & rs("Image") & """>"%>

    <% response.write("</td><td </td><td width='25%'><font size='1'>")%><%=rs("Manufacturer")%>
    <% 'response.write("</td><td><font size='1'>")%><%'=rs("Description")%>
    <% response.write("</font></td></tr></table>")%>

    <%
    rs.moveNext
    Loop
    rs.close
    Set rs = nothing
    %>

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    How exactly are you trying to get this image??

    Why don't you link directly, something like....
    Code:
    <%Response.Write "</td><td width='25%' align=center><img src=""catalog/Images/" & rs("Image") & """>"%>
    or is there some more complex logic meant to be happening somewhere? If so what is it?

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    How exactly are you trying to get this image??

    Why don't you link directly, something like....
    Code:
    <%Response.Write "</td><td width='25%' align=center><img src=""catalog/Images/" & rs("Image") & """>"%>
    or is there some more complex logic meant to be happening somewhere? If so what is it?

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    How exactly are you trying to get this image??

    Why don't you link directly, something like....
    Code:
    <%Response.Write "</td><td width='25%' align=center><img src=""catalog/Images/" & rs("Image") & """>"%>
    or is there some more complex logic meant to be happening somewhere? If so what is it?

  5. #5
    Join Date
    Oct 2004
    Posts
    6
    that worked. thank you very much!!! it was my syntax that prevented me from displaying those images. here is what i used.

    <%Response.Write "</td><td width='25%' align=center><img src=""catalog_imgs/" & rs("Image") & """>"%>

    thanks again!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •