If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > diplaying images in asp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-04, 10:01
jmaresca2004 jmaresca2004 is offline
Registered User
 
Join Date: Oct 2004
Posts: 6
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
%>
Reply With Quote
  #2 (permalink)  
Old 11-02-04, 17:02
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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?
Reply With Quote
  #3 (permalink)  
Old 11-02-04, 17:04
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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?
Reply With Quote
  #4 (permalink)  
Old 11-02-04, 17:13
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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?
Reply With Quote
  #5 (permalink)  
Old 11-03-04, 12:48
jmaresca2004 jmaresca2004 is offline
Registered User
 
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!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On