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

asp 简单循环更新数据(求助)
我想实现把 Article_KeyWords 表里面的 click字段全部改为request("click"),下面写的好像不对。conn已连接。
请帮忙 !

click=request("click")
if click>0 then
sql="select * from Article_KeyWords"
rs.open sql,conn,1,3
do while not rs.eof 
rs.click=click
rs.update
rs.movenext
loop
end if

------解决方案--------------------
VBScript code

<%
click = Trim(request("click"))
If IsNumeric(click) Then
  If CInt(click)>0 Then
    sql = "UPDATE Article_KeyWords SET click=" & click
    conn.execute sql
  End if
End If
conn.close
Set conn = Nothing
%>

------解决方案--------------------
conn.execute "uPDATE Article_KeyWords SET click=" & click

------解决方案--------------------
<%
click = Trim(request("click"))
If len(click)>0 and IsNumeric(click) Then
If CInt(click)>0 Then
sql = "UPDATE Article_KeyWords SET click=" & click
conn.execute(sql)
End if
End If
conn.close : Set conn = Nothing

%>