Thimo
10-30-2002, 02:56 PM
hi, those who replied to my previous threads should have a better idea what i am going to say...
<%
Dim whereClause, rs
For Each Item in Request.Form("add")
If whereClause <> "" then
whereClause = whereClause & "OR ItemID=" & item
Else
whereClause = "ItemID=" & item
End If
Next
strSQL = "SELECT * FROM Item WHERE " & whereClause
set rs = objConn.Execute(strSQL)
%>
<%
Do until rs.EOF
dim rs2
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.AddNew
rs2("ItemName") = rs("ItemName")
rs2("ItemCode") = rs("ItemCode")
rs2("Price") = rs("Price")
rs2("RQuantity") = Request.Form("RQty")
rs2.Update
rs.MoveNext
loop
%>
<%
Dim display, rs3
display = "SELECT * FROM Staff"
set rs3 = objConn.Execute(display)
%>
<form>
<table border="1" align="center">
<tr>
<th height="25">Item Code</th>
<th>ItemName</th>
<th>Requested Quantity</th>
<th>Price</th>
</tr>
<%Do While Not rs.EOF%>
<tr align=center>
<td><%=rs3("ItemCode")%></td>
<td align=left><%=rs3("ItemName")%></td>
<td><%rs3("RQuantity")%></td>
<td><%=FormatCurrency(rs("Price"))%></td>
<tr>
<%rs.MoveNext%>
<%loop%>
</table>
<p> </p>
<center>
</center>
</form>
</body>
</html>
to summarise the problem...actually is my Request.Form("RQty") has an array of values, how do i corresspond it like ...when the user enter for example...
Item 1 , RQty = 10
Item 1 , RQty = 20
the value i get in Request.Form is an array of value which is 10, 20
is there anyway i can break up the array?
thanks..btw this is the error msg i received...
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/asp/DisplayCart.asp, line 35
Page:
POST 41 bytes to /asp/DisplayCart.asp
POST Data:
RQty=1&Qty=1000&add=6&RQty=1&Qty=50&add=7
<%
Dim whereClause, rs
For Each Item in Request.Form("add")
If whereClause <> "" then
whereClause = whereClause & "OR ItemID=" & item
Else
whereClause = "ItemID=" & item
End If
Next
strSQL = "SELECT * FROM Item WHERE " & whereClause
set rs = objConn.Execute(strSQL)
%>
<%
Do until rs.EOF
dim rs2
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.AddNew
rs2("ItemName") = rs("ItemName")
rs2("ItemCode") = rs("ItemCode")
rs2("Price") = rs("Price")
rs2("RQuantity") = Request.Form("RQty")
rs2.Update
rs.MoveNext
loop
%>
<%
Dim display, rs3
display = "SELECT * FROM Staff"
set rs3 = objConn.Execute(display)
%>
<form>
<table border="1" align="center">
<tr>
<th height="25">Item Code</th>
<th>ItemName</th>
<th>Requested Quantity</th>
<th>Price</th>
</tr>
<%Do While Not rs.EOF%>
<tr align=center>
<td><%=rs3("ItemCode")%></td>
<td align=left><%=rs3("ItemName")%></td>
<td><%rs3("RQuantity")%></td>
<td><%=FormatCurrency(rs("Price"))%></td>
<tr>
<%rs.MoveNext%>
<%loop%>
</table>
<p> </p>
<center>
</center>
</form>
</body>
</html>
to summarise the problem...actually is my Request.Form("RQty") has an array of values, how do i corresspond it like ...when the user enter for example...
Item 1 , RQty = 10
Item 1 , RQty = 20
the value i get in Request.Form is an array of value which is 10, 20
is there anyway i can break up the array?
thanks..btw this is the error msg i received...
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/asp/DisplayCart.asp, line 35
Page:
POST 41 bytes to /asp/DisplayCart.asp
POST Data:
RQty=1&Qty=1000&add=6&RQty=1&Qty=50&add=7