当前位置: 代码迷 >> ASP >> 请问一个批量update命令
  详细解决方案

请问一个批量update命令

热度:341   发布时间:2012-03-18 13:55:39.0
请教一个批量update命令
我是要批量更新images表中的s_height字段。
前一个页面传递过来的 s_height 和 Image_id 是一批,几十个,值都不同。

set s_height=Request.Form("s_height")

conn.execute("update images set s_height="&s_height&" where Image_id="&Image_id)

上面我这个是错误的。

正确的应该如何?谢谢高手。

------解决方案--------------------
heights=split(s_height,",")
images=split(image_id,",")
count=ubound(heights)
for i=0 to count
a=heights(i);
b=images(i);
conn.execute("update images set s_height='"&a&"' where Image_id="&b)
next
  相关解决方案