Click to See Complete Forum and Search --> : coding is not working!?


Laith jodeh
03-21-2010, 07:49 AM
Dear All I've tried to customize the following code with no success to retreive
ms database from table called items and show them in iterated form for all
records and for each record; there are update & delete control buttons to do
update and deletion action for each record without leaving the asp page. Any help??


<HTML>
<HEAD>
<TITLE>First SELECT Example</TITLE>
<BODY>
<B>In this example, only the fifth record in the Catalog table is returned.</B>
<HR>
<%

Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")


Conn.Open "montaser"


sSQL = "SELECT * FROM items WHERE barcode='123'"


Set Rs = Conn.Execute(sSQL)
Rs.MoveFirst
<form action="" method="post" name="update" id="update">

<table width="100%" border="1">
<tr class="TextReg">
<td width="163" bordercolor="#000033" bgcolor="#666699"><strong><font color="#FFFFFF">Iitem desc </font></strong></td>
<td width="207"> <input name="item_desc" type="text" value="<%Response.Write Rs("item_desc")%>">
</td>
</tr>
<tr>
<td width="163" bordercolor="#000033" bgcolor="#666699"><font color="#FFFFFF"><strong>item id</strong></font></td>
<td width="207"> <input name="item_id" type="text" value="<%Response.Write Rs("item_id")%>">
</td>
</tr>
<tr>
<td bordercolor="#000033" bgcolor="#666699"><strong><font color="#FFFFFF">item origin</font></strong></td>
<td> <input type="text" name="item_origin" value = "<%Response.Write Rs("item_origin")%>" >
</td>
</tr>
<tr>
<td bordercolor="#000033" bgcolor="#666699"><strong><font color="#FFFFFF">item price </font></strong></td>
<td> <input type="text" name="item_price" value="<%Response.Write Rs("item_price")%> ">
</td>



<tr>
<td height="22" bordercolor="#000033" bgcolor="#666699">&nbsp;</td>
<td><input name="Update" type="submit" id="Update" value="Update"> <input name="delete" type="submit" id="delete" value="Delete ">
</td>
</tr>
</table>
Do While NOT Rs.EOF
'Response.Write items("Title") & "<p>"


Rs.MoveNext
Loop


Rs.Close
Set Rs = Nothing


Conn.Close
Set Conn = Nothing

%>
</table>
</form>

</BODY>
</HTML>

yamaharuss
03-22-2010, 07:22 AM
This is some messed up code. You have multiple submit buttons with one form, an embedded loop.. I think you better start over.