A
Amateur
Dear Sirs
I am trying to show all data from a databse in my page - but somehow I am
not coming out of the loop and the page doesn't open. Can someone tell me
what I did wrong?
Here is the code:
<table border="1" width="100%">
<tr>
<td align="left" valign="top" class="formpagetablelabel">tradeid</td></td>
<td align="left" valign="top"
class="formpagetablelabel">clearingnumber</td></td>
<td align="left" valign="top" class="formpagetablelabel">fecha</td>
<td align="left" valign="top" class="formpagetablelabel">bought</td>
<td align="left" valign="top" class="formpagetablelabel">sold</td>
<td align="left" valign="top" class="formpagetablelabel">commodity</td>
<td align="left" valign="top" class="formpagetablelabel">month</td>
<td align="left" valign="top" class="formpagetablelabel">year</td>
<td align="left" valign="top" class="formpagetablelabel">price</td>
<td align="left" valign="top" class="formpagetablelabel">contractvalue</td>
</tr>
<%
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.bellfield-barna.com\Data\transferdb.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
%>
<td><input class="formpagetablefield" type="text" name="tradeid" size="6"
Value="<%=trim(rsTable("tradeid"))%>"></td>
<td><input class="formpagetablefield" type="text" name="clearingnumber"
size="50" Value="<%=trim(rsTable("clearingnumber"))%>"></td>
<td><input class="formpagetablefield" type="text" name="fecha" size="50"
Value="<%=trim(rsTable("fecha"))%>"></td>
<td><input class="formpagetablefield" type="text" name="bought" size="12"
Value="<%=trim(rsTable("bought"))%>"></td>
<td><input class="formpagetablefield" type="text" name="sold" size="12"
Value="<%=trim(rsTable("sold"))%>"></td>
<td><input class="formpagetablefield" type="text" name="commodity" size="30"
Value="<%=trim(rsTable("commodity"))%>"></td>
<td><input class="formpagetablefield" type="text" name="month" size="50"
Value="<%=trim(rsTable("month"))%>"></td>
<td><input class="formpagetablefield" type="text" name="year" size="50"
Value="<%=trim(rsTable("year"))%>"></td>
<td><input class="formpagetablefield" type="text" name="price" size="12"
Value="<%=trim(rsTable("price"))%>"></td>
<td class="formpagetablelabel"><input class="formpagetablefield" type="text"
name="contractvalue" size="8"
Value="<%=trim(rsTable("contractvalue"))%>"><font class="formpagetablefield">
US$</div></td>
</tr>
....
<%
rs.MoveNext
Wend
' Close recordset
rsTable.Close
Set rsTable = Nothing
' Close connection
conntemp.Close
Set conntemp = Nothing
%>
I am trying to show all data from a databse in my page - but somehow I am
not coming out of the loop and the page doesn't open. Can someone tell me
what I did wrong?
Here is the code:
<table border="1" width="100%">
<tr>
<td align="left" valign="top" class="formpagetablelabel">tradeid</td></td>
<td align="left" valign="top"
class="formpagetablelabel">clearingnumber</td></td>
<td align="left" valign="top" class="formpagetablelabel">fecha</td>
<td align="left" valign="top" class="formpagetablelabel">bought</td>
<td align="left" valign="top" class="formpagetablelabel">sold</td>
<td align="left" valign="top" class="formpagetablelabel">commodity</td>
<td align="left" valign="top" class="formpagetablelabel">month</td>
<td align="left" valign="top" class="formpagetablelabel">year</td>
<td align="left" valign="top" class="formpagetablelabel">price</td>
<td align="left" valign="top" class="formpagetablelabel">contractvalue</td>
</tr>
<%
Set conntemp = server.CreateObject("adodb.Connection")
conntemp.open
"DSN=access;Database=f:\www.bellfield-barna.com\Data\transferdb.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
%>
<td><input class="formpagetablefield" type="text" name="tradeid" size="6"
Value="<%=trim(rsTable("tradeid"))%>"></td>
<td><input class="formpagetablefield" type="text" name="clearingnumber"
size="50" Value="<%=trim(rsTable("clearingnumber"))%>"></td>
<td><input class="formpagetablefield" type="text" name="fecha" size="50"
Value="<%=trim(rsTable("fecha"))%>"></td>
<td><input class="formpagetablefield" type="text" name="bought" size="12"
Value="<%=trim(rsTable("bought"))%>"></td>
<td><input class="formpagetablefield" type="text" name="sold" size="12"
Value="<%=trim(rsTable("sold"))%>"></td>
<td><input class="formpagetablefield" type="text" name="commodity" size="30"
Value="<%=trim(rsTable("commodity"))%>"></td>
<td><input class="formpagetablefield" type="text" name="month" size="50"
Value="<%=trim(rsTable("month"))%>"></td>
<td><input class="formpagetablefield" type="text" name="year" size="50"
Value="<%=trim(rsTable("year"))%>"></td>
<td><input class="formpagetablefield" type="text" name="price" size="12"
Value="<%=trim(rsTable("price"))%>"></td>
<td class="formpagetablelabel"><input class="formpagetablefield" type="text"
name="contractvalue" size="8"
Value="<%=trim(rsTable("contractvalue"))%>"><font class="formpagetablefield">
US$</div></td>
</tr>
....
<%
rs.MoveNext
Wend
' Close recordset
rsTable.Close
Set rsTable = Nothing
' Close connection
conntemp.Close
Set conntemp = Nothing
%>