- 爱易网页
-
ASP教程
- 用in如何不能批量更新了呢
日期:2014-05-17 浏览次数:20881 次
用in怎么不能批量更新了呢?
<div align= "center ">
<input type= "checkbox " name= "UserID " value= " <%=rsT( "UserID ")%> " />
</div>
这里可以复选,相关代码如下:
If InStr(UserID, ", ")> 0 Then
sql = "select * from Fee where UserID in ( "&UserID& ") order by FeeID desc "
Else
sql = "select * from Fee where UserID = "&UserID& " order by FeeID desc "
End If
Set rs = Server.CreateObject( "Adodb.Recordset ")
rs.Open sql, cn, 1, 3
If rs.EOF And rs.bof Then
Response.Write( "该会员不存在 ")
Exit Sub
Else
Do While Not rs.EOF
tmpUserID = rs( "UserID ")
Set tmpRs = cn.Execute( "select top 1 * from Fee Where UserID = "&tmpUserID& " order by FeeID desc ")
tmpBalance = tmpRs( "Balance ")
rs.addnew
rs( "UserID ") = tmpUserID
rs( "FeeActionID ") = tmpFeeActionID
rs( "Amount ") = tmpBalance
rs( "Balance ") = 0
rs( "PostUser ") = ManageUser
rs.update
rs.movenext
Loop
End If
rs.Close
Set rs = Nothing
我看动易也是这样写的,怎么他的可以,我的不可以呢?执行了以后,总是执行第一条语句,后面的没反应
------解决方案--------------------