日期:2014-05-17  浏览次数:20775 次

请教一个批量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