读书人

请问一个批量update命令

发布时间: 2012-03-18 13:55:39 作者: rapoo

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

读书人网 >ASP

热点推荐