Forums
This topic is locked
Multiple Updating
Posted 08 Nov 2002 19:22:14
1
has voted
08 Nov 2002 19:22:14 Tony Chronopoulos posted:
Hi everyone..I'm trying to do multiple updating on a site. I've been playing around with this for 1 day now and I'm going NUTS!!
here is a part of my code:
<pre id=code><font face=courier size=2 id=code>
For iLoop = 0 to iCount
strSKU = Request.Form(iLoop & ".txt_sku"
strID = Request.Form(iLoop & ".ID"
strSQL = "UPDATE tbl_products SET prod_sku = " & strSKU & " WHERE prod_id = " & strID
objConn.Execute strSQL
Next
</font id=code></pre id=code>
now, the problem is that it works only if strSKU contains only numbers. If there is any text, it doesn't work. I found 2 different tutorials on the net and my code matches. My actual field in my Access DB is set to TEXT.
I'm entirely lost! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Thanks
___________________
Lunch is on me! <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Replies
Replied 12 Nov 2002 19:52:04
12 Nov 2002 19:52:04 Dan Price replied:
If the field is a string, you need to surround it in quotes (single) so it should look like this:
strSQL = "UPDATE tbl_products SET prod_sku = '" & strSKU & "' WHERE prod_id = " & strID
Hope that works.
strSQL = "UPDATE tbl_products SET prod_sku = '" & strSKU & "' WHERE prod_id = " & strID
Hope that works.