469,898 Members | 1,599 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

update multiple records corresponding to ID in one go ?

Fary4u
273 100+
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
1 1676
GazMathias
224 Expert 128KB
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.

Similar topics

16 posts views Thread by Philip Boonzaaier | last post: by
1 post views Thread by Wing | last post: by
3 posts views Thread by Roy | last post: by
reply views Thread by Access Programming only with macros, no code | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.