By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,053 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,053 IT Pros & Developers. It's quick & easy.

update multiple records corresponding to ID in one go ?

Fary4u
100+
P: 273
how can i update multiple records corresponding to perticular ID & update values in one go ?

mode_a contains ID No.

Expand|Select|Wrap|Line Numbers
  1. Dim mode,mode_a,i
  2. mode=Request("t1")
  3.  
  4. mode_a=split(mode,",") 
  5.  
  6. For i=LBound(mode_a) to UBound(mode_a)
  7. Response.Write mode_a(i) + "<br>"
  8.  
  9. sqlText = "UPDATE products SET productStock = 'yes' where productID = '"& mode_a &"'"
  10. Response.Write sqlText
  11.  
  12. Next 
  13.  
giving me this error ?

Line 9
Microsoft VBScript runtime (0x800A000D)
Type mismatch
Nov 13 '09 #1
Share this Question
Share on Google+
1 Reply


GazMathias
Expert 100+
P: 189
Hi,

If your ID field is numeric, it should not have quotes around it:

Expand|Select|Wrap|Line Numbers
  1. productID = " &  mode_a
  2.  
That is why you are receiving a type mismatch error.

Edit:

Just realised that mode_a is an array.

In that case you may need to use the IN operator.

Expand|Select|Wrap|Line Numbers
  1. WHERE (productID In (" &  mode_a & "))"
  2.  
Gaz
Nov 13 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.