Big Daddy Turbo
10-09-2006, 05:21 PM
Hi I was wondering if someone could help me with this problem.
I need to update the quantites column in a stock table so I created a stock update form in asp with headings 'Product Name' and 'Quantity'. Quantity is a text field which is initially prepopulated with stock amounts from the stock table. I've named each text field the same as the stock_id so I can establish which row the new quantity relates to after submission
The end user updates each stock value manually using the form before clicking an update button to submit the form for processing. Here is the start of my problem
I am trying to iterate back through the stock table to update each row. I creat an update statement like this
DO UNTIL rsStockID.eof
rsUpdate = "rs" & update_id
SET rsUpdate = Server.CreateObject("ADODB.Recordset")
rsUpdate.open "UPDATE tbl_stock SET quantity = " & request("qty_" & update_id) & " WHERE stock_id =" & update_id, objConn, 2, 2
rsUpdate.close
rsUpdate = nothing
rsStockID.movenext
LOOP
I'm sure I'm making a massive schoolboy error but why does the script keep timing out and no rows get updated. I'm sure this sort of procedure is common practice for most web developers but I don't know where I'm going wrong. Any advice would be greatly appreciated
Cheers, Andi
I need to update the quantites column in a stock table so I created a stock update form in asp with headings 'Product Name' and 'Quantity'. Quantity is a text field which is initially prepopulated with stock amounts from the stock table. I've named each text field the same as the stock_id so I can establish which row the new quantity relates to after submission
The end user updates each stock value manually using the form before clicking an update button to submit the form for processing. Here is the start of my problem
I am trying to iterate back through the stock table to update each row. I creat an update statement like this
DO UNTIL rsStockID.eof
rsUpdate = "rs" & update_id
SET rsUpdate = Server.CreateObject("ADODB.Recordset")
rsUpdate.open "UPDATE tbl_stock SET quantity = " & request("qty_" & update_id) & " WHERE stock_id =" & update_id, objConn, 2, 2
rsUpdate.close
rsUpdate = nothing
rsStockID.movenext
LOOP
I'm sure I'm making a massive schoolboy error but why does the script keep timing out and no rows get updated. I'm sure this sort of procedure is common practice for most web developers but I don't know where I'm going wrong. Any advice would be greatly appreciated
Cheers, Andi