I have a client application that uses an MSDE local database to build reports formatted as web pages including pictures. Pictures are stored in a virtual directory. Reports/web pages are built against a temp table in the MSDE with picture names in a field in the records. The problem is that not all of the pictures display, showing as broken links. This is apparently random, as rerunning the report results in different picture links being broken and those that showed broken previously now are automagically displayed. I believe it is only a matter of tweaking, but don't have a clue where to start. The page code is shown below:
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Showroom Setup Report</title>
</head>
<body>
<style type="text/css">
<!--
td { font-family: sans-serif; font-size: 9pt; }
br.page { page-break-before: always; }
-->
</style>
<%
dim conn, counter
dim rs
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB.1;SERVER=127.0.0.1;Database=Products;uid=sa;pwd=xxxxxx"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT preliminary_number, sb_number, item_picpath, series_vendor, series_description, item_description, factory_number, series_factory_assortment_comments, item_factory_component_comments, series_name from tblReports order by preliminary_number ASC", conn
%>
<table border = "2" align="center" width="90%" cellspacing="0" cellpadding="4">
<tr>
<td align="center" colspan="3"><h1 style="font-family:verdana">Showroom Setup Report : <%=rs.fields(9) %></h1></td>
</tr>
<tr>
<th align="left" valign="top" width="15%"> Item Picture </th>
<th align="left" valign="top" width="12%"> Vendor<br/>Preliminary Number<br/>Factory Number<br/>SB Number</th>
<th align="left" valign="top" width="50%"> Series Description<br/>Item Description<br/>Series Factory Assortment Comments<br/>Item Component Comments</th>
</tr>
<%
While Not rs.EOF
%>
<tr>
<td align="left" valign="top" width="15%" rowspan = "6"> <IMG HEIGHT=150 Width=150 border=0 SRC="SBPictures/<%=RS.Fields(2)%>"></td>
<td align="left" valign="top" width="12%" > <%= RS.Fields(3) %></td>
<td align="left" valign="top" width="50%" colspan = "2" rowspan = "2"> <%= RS.Fields(4) %></td>
</tr>
<tr>
<td align="left" valign="top" width="12%"> <%= RS.Fields(0) %></td>
</tr>
<tr>
<td align="left" valign="top" width="12%"> <%= RS.Fields(6) %></td>
<td align="left" valign="top" width="50%" colspan = "2" rowspan = "2"> <%= RS.Fields(5) %></td>
</tr>
<tr>
<td align="left" valign="top" width="12%"> <%= RS.Fields(1) %></td>
</tr>
<tr>
<td align="left" valign="top" width="15%"></td>
<td align="left" valign="top" width="50%" colspan = "2"><%= RS.Fields(7) %></td>
</tr>
<tr>
<td align="left" valign="top" width="15%"></td>
<td align="left" valign="top" width="50%" colspan = "2"><%= RS.Fields(8) %></td>
</tr>
</tr>
<%
Counter = Counter + 1
if Counter = 5 then
Response.Write "</table>"
response.write "<br class=""page"" />"
%>
<table align="center" width="90%" border="2" cellspacing="0" cellpadding="4">
<tr>
<td align="center" colspan="3"><h1 style="font-family:verdana">Showroom Setup Report</h1></td>
</tr>
<tr>
<th align="left" valign="top" width="15%"> Item Picture </th>
<th align="left" valign="top" width="12%"> Vendor<br/>Preliminary Number<br/>Factory Number<br/>SB Number</th>
<th align="left" valign="top" width="50%"> Series Description<br/>Item Description<br/>Series Factory Assortment Comments<br/>Item Component Comments</th>
</tr>
<%
Counter = 0
end if
rs.MoveNext
Wend
rs.Close
conn.Close
set rs=nothing
set conn=nothing
%>
</table>
</body>
</html>