Smallwolves Bolgs
Do what you ought to do,don't waste your youth! Everything is possible if you do it by heart!

如我们用checkbox得到的SQL语句是这样的```
sql1="select * from tb where sid in('2592222,3383679058')"

现在要怎么变成
sql1="select * from tb where sid in('2592222','3383679058')"

也就是说括号里要用单引号分开 ,不然更新不了```

<input name="checkid" type="checkbox" id="checkid" value="<%=cstr(rs("sid"))%>">

具体解决代码如下
dim id
id=trim(request("checkid")) '从上一页得到的CHECKBOX选中的项

action=request("action")
if request("action")="modify" then
sid=request("id")
pp=trim(request("pp"))
dim rs1,sql1,str2
s1=server.CreateObject("adodb.recordset")
str2=replace(sphoneid," , ","','")
sql1="select * from tb  where sid in('"&str2&"')"
rs1.open sql1,conn,1,3
response.write sql1
do while not rs1.eof
rs1("pp")=pp
rs1.update
rs1.MoveNext
loop
response.write ("恭喜您,修改成功!!!")
end if

posted on 2006-04-08 10:14  ╰狼骑士  阅读(1223)  评论(2)    收藏  举报