Forum Moderators: open

Message Too Old, No Replies

Images not shown on ASP results page

ASP Image display

         

shearder

8:48 pm on Nov 20, 2003 (gmt 0)

10+ Year Member


Hi All

I have seen some of the posts on this issue but none specific to my needs. Perhaps I may seem a little "slow but bare with me please.

I have a database i.e. example.mdb and I have a table which I use to save Hardware item information. Now, I have the following fields:

ID
Code
Type
Description
Price
Image (this field is formated as a text field)

When I use the folllowing code i see all the information from the datebase but i do not see the image except for the text i.e. image.gif: (generated by Frontpage)

<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,Type,Description,Price,Picture" s-columntypes="3,202,202,202,202" s-dataconnection="specials" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource="Specials" s-displaycolumns="ID,Type,Description,Price,Picture" s-criteria s-order s-sql="SELECT * FROM Specials" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="5" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Specials"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=5 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="specials"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=5
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="41967" --><tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Type,Description,Price,Picture" s-column="ID" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;ID&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"ID")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="62813" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Type,Description,Price,Picture" s-column="Type" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Type&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Type")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="7359" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Type,Description,Price,Picture" s-column="Description" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Description&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Description")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="30092" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Type,Description,Price,Picture" s-column="Price" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Price&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Price")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="9640" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Type,Description,Price,Picture" s-column="Picture" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Picture&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Picture")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13538" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="5" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD ALIGN=LEFT VALIGN=MIDDLE COLSPAN=64&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button VALUE=&quot; ¦&lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &lt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt; &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot; &gt;¦ &quot;&gt; [1/5]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" -->

Any help? I do not know a thing about coding with ASP so please give me a break.

Thanks and Regards,

Sean

WebJoe

10:26 pm on Nov 20, 2003 (gmt 0)

10+ Year Member



Assuming that your db-field image contains the filename of the image, you'd have to change

<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Type,Description,Price,Picture" s-column="Picture" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Picture&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Picture")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="13538" -->

manually to

<IMG SRC="<%=FP_Field(fp_rs,"Picture")%>" ALT="somealttext" HEIGHT="123" WIDTH="456">

to display the image.
You can replace it in html-view without a problem, I did it so many times before I learned to code asp manually

shearder

5:25 am on Nov 21, 2003 (gmt 0)

10+ Year Member



First, WebJoe, thanks a stack. It seems i am getting somewhere with this, however, i replaced the code and viewed the page and it gives me what i want but the picture has a a not-found red X where it should be.

Is it correct that my database field is text formating and how would I correctly display the path? i.e. ../images/example.gif OR <img src="/image/example.gif> etc etc.

Thanks again

shearder

5:34 am on Nov 21, 2003 (gmt 0)

10+ Year Member



WEBJOE! Oh you ARE the man! it is sorted and working! Thanks again. I found that when i pasted the code and removed the other, the <> brackets were changed to "alt..." etc. I fixed that and now it works like a charm!

I really appreciate this.

Regards,

Sean

WebJoe

11:39 pm on Nov 21, 2003 (gmt 0)

10+ Year Member



NP, glad I could help