A
Amateur
Dear Sirs
I have an ASP page in a table style (heading and data).
At the beginn of each month (actually only the first day) there is no data
in my database and so-with nothing to show up on the ASP page.
If I would like to open the ASP page over the net IE is telling me that it
cannot find my page. I believe it has something to do with EOF - but I have
no idea how to make it work.
Can someone tell me how, even if there are no records to show, at least the
heading is shown on the Internet?
Here is the code:
<body class="formpage" style="background-color: #DFDFDF" topmargin="6"
leftmargin="0" rightmargin="0" bottommargin="0">
<table width="561" border="0" height="100">
<tr>
<td align="Left" valign="Middle" height="96" width="555" >
<form method="GET" action="offsetordersbie30p.asp"
name="weboffsetordersbie30p" onSubmit="return Checkform(this);">
<table border="0" cellpadding="0" cellspacing="0" class="formpagetable"
width="303" style="border-width: 0">
<tr>
<td colspan="2">
<table width="552" border="0">
<tr>
<td align="left" valign="top" height="14" width="548"><img border="0"
src="../BIE/images/c1_top.GIF" width="547" height="14"></td>
</tr>
</tr>
</table>
</td>
<table border="0" width="490" height="40">
<tr>
<td align="center" valign="top" class="formpagetablelabel"
width="54"><b>Fecha</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="15"><b>C</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="15"><b>V</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="143"><b>MercancÃa</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="48"><b>Mes</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="25"><b>Año</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="64"><b>Precio</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="92"><b>Valor</b></td>
</tr>
<%
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.???????????.com\????\????????????.mdb"
SqlStr ="SELECT * FROM weboffsetordersbie30p ORDER BY commodity"
Set rsTable = conntemp.Execute(SqlStr)
' Cycle through the recordset, building a table row from each record.
While not rsTable.EOF
%>
<tr>
<td width="54"><input class="formpagetablefield" type="text"
style="text-align: center;" name="fecha" size="9"
Value="<%=trim(rsTable("fecha"))%>"></td>
<td width="15"><input class="formpagetablefield" type="text"
style="text-align: center;" name="bought" size="1"
Value="<%=trim(rsTable("bought"))%>"></td>
<td width="15"><input class="formpagetablefield" type="text"
style="text-align: center;" name="sold" size="1"
Value="<%=trim(rsTable("sold"))%>"></td>
<td width="143"><input class="formpagetablefield" type="text"
style="text-align: center;" name="commodity" size="27"
Value="<%=trim(rsTable("commodity"))%>"></td>
<td width="48"><input class="formpagetablefield" type="text"
style="text-align: center;" name="month" size="8"
Value="<%=trim(rsTable("month"))%>"></td>
<td width="25"><input class="formpagetablefield" type="text"
style="text-align: center;" name="year" size="3"
Value="<%=trim(rsTable("year"))%>"></td>
<style type="text/css">
<!--
..pos {
font-family: Tahoma; font-size: 8pt;
color: #000000;
text-align:right;
}
..neg {
font-family: Tahoma; font-size: 8pt;
color: #FF0000;
text-align:right;
}
-->
</style>
<%
If CSng(rsTable("price")) < 0 Then
textboxclass = "neg"
Else
textboxclass = "pos"
End If
%>
<td width="64"><input class="<%=textboxclass%>" type="number" name="price"
size="8" Value="<%=formatnumber(rsTable("price"),4,-1,-1,-1)%>"></td>
<style type="text/css">
<!--
..pos {
font-family: Tahoma; font-size: 8pt;
text-align:right;
color: #0000FF;
}
..neg {
font-family: Tahoma; font-size: 8pt;
text-align:right;
color: #FF0000;
}
-->
</style>
<%
If CSng(rsTable("contractvalue")) < 0 Then
textboxclass = "neg"
Else
textboxclass = "pos"
End If
%>
<td width="92"><input class="<%=textboxclass%>" type="number"
name="contractvalue" size="12"
Value="<%=formatNumber(rsTable("contractvalue"),2,-1,-1,-1)%>"></div></td>
</tr>
<%
rsTable.movenext
Wend
' Close recordset
rsTable.Close
Set rsTable = Nothing
' Close connection
conntemp.Close
Set conntemp = Nothing
%>
</table>
</form>
</tr>
</table>
I have an ASP page in a table style (heading and data).
At the beginn of each month (actually only the first day) there is no data
in my database and so-with nothing to show up on the ASP page.
If I would like to open the ASP page over the net IE is telling me that it
cannot find my page. I believe it has something to do with EOF - but I have
no idea how to make it work.
Can someone tell me how, even if there are no records to show, at least the
heading is shown on the Internet?
Here is the code:
<body class="formpage" style="background-color: #DFDFDF" topmargin="6"
leftmargin="0" rightmargin="0" bottommargin="0">
<table width="561" border="0" height="100">
<tr>
<td align="Left" valign="Middle" height="96" width="555" >
<form method="GET" action="offsetordersbie30p.asp"
name="weboffsetordersbie30p" onSubmit="return Checkform(this);">
<table border="0" cellpadding="0" cellspacing="0" class="formpagetable"
width="303" style="border-width: 0">
<tr>
<td colspan="2">
<table width="552" border="0">
<tr>
<td align="left" valign="top" height="14" width="548"><img border="0"
src="../BIE/images/c1_top.GIF" width="547" height="14"></td>
</tr>
</tr>
</table>
</td>
<table border="0" width="490" height="40">
<tr>
<td align="center" valign="top" class="formpagetablelabel"
width="54"><b>Fecha</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="15"><b>C</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="15"><b>V</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="143"><b>MercancÃa</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="48"><b>Mes</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="25"><b>Año</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="64"><b>Precio</b></td>
<td align="center" valign="top" class="formpagetablelabel"
width="92"><b>Valor</b></td>
</tr>
<%
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.???????????.com\????\????????????.mdb"
SqlStr ="SELECT * FROM weboffsetordersbie30p ORDER BY commodity"
Set rsTable = conntemp.Execute(SqlStr)
' Cycle through the recordset, building a table row from each record.
While not rsTable.EOF
%>
<tr>
<td width="54"><input class="formpagetablefield" type="text"
style="text-align: center;" name="fecha" size="9"
Value="<%=trim(rsTable("fecha"))%>"></td>
<td width="15"><input class="formpagetablefield" type="text"
style="text-align: center;" name="bought" size="1"
Value="<%=trim(rsTable("bought"))%>"></td>
<td width="15"><input class="formpagetablefield" type="text"
style="text-align: center;" name="sold" size="1"
Value="<%=trim(rsTable("sold"))%>"></td>
<td width="143"><input class="formpagetablefield" type="text"
style="text-align: center;" name="commodity" size="27"
Value="<%=trim(rsTable("commodity"))%>"></td>
<td width="48"><input class="formpagetablefield" type="text"
style="text-align: center;" name="month" size="8"
Value="<%=trim(rsTable("month"))%>"></td>
<td width="25"><input class="formpagetablefield" type="text"
style="text-align: center;" name="year" size="3"
Value="<%=trim(rsTable("year"))%>"></td>
<style type="text/css">
<!--
..pos {
font-family: Tahoma; font-size: 8pt;
color: #000000;
text-align:right;
}
..neg {
font-family: Tahoma; font-size: 8pt;
color: #FF0000;
text-align:right;
}
-->
</style>
<%
If CSng(rsTable("price")) < 0 Then
textboxclass = "neg"
Else
textboxclass = "pos"
End If
%>
<td width="64"><input class="<%=textboxclass%>" type="number" name="price"
size="8" Value="<%=formatnumber(rsTable("price"),4,-1,-1,-1)%>"></td>
<style type="text/css">
<!--
..pos {
font-family: Tahoma; font-size: 8pt;
text-align:right;
color: #0000FF;
}
..neg {
font-family: Tahoma; font-size: 8pt;
text-align:right;
color: #FF0000;
}
-->
</style>
<%
If CSng(rsTable("contractvalue")) < 0 Then
textboxclass = "neg"
Else
textboxclass = "pos"
End If
%>
<td width="92"><input class="<%=textboxclass%>" type="number"
name="contractvalue" size="12"
Value="<%=formatNumber(rsTable("contractvalue"),2,-1,-1,-1)%>"></div></td>
</tr>
<%
rsTable.movenext
Wend
' Close recordset
rsTable.Close
Set rsTable = Nothing
' Close connection
conntemp.Close
Set conntemp = Nothing
%>
</table>
</form>
</tr>
</table>