set rs=server.createobject("adodb.recordset")
rs.Open sql,conn,3,3
'cn.execute(sql)
rs对象能够执行Update的SQL语句吗?
有谁能帮我看看这有什么问题呀,程序运行没提示错误,可在数据库中不能改变记录的值呀,就是那句UPDATE不执行,为什么呢?
<!--#include file="conn.asp" -->
<%set rs=server.createobject("adodb.recordset") %>
<%
name=request("name1")
pwd0=request("pwd0")
pwd1=request("pwd1")
set cn=server.createobject("adodb.connection")
'set rs=server.createobject("adodb.recordset")
sql="select * from admin where admin_name='"&name&"'"
rs.Open sql,conn,1,1
if not(rs.EOF or rs.bof) then
sql="update admin set admin_pwd='"&pwd1&"' where (admin_name='"&name&"'& admin_pwd='"&pwdo&"')"
set rs=server.createobject("adodb.recordset")
rs.Open sql,conn,3,3
'cn.execute(sql)
response.write "<script language=JavaScript>" & chr(13) & "alert('OK! 信息修改成功!');"&"window.location.href = 'admin.asp'"&" </script>"
set rs1=nothing
else
response.write "<script language=JavaScript>" & chr(13) & "alert('对不起!不能修改!');" & "history.back()" & "</script>"
end if
'cn.close
'set cn=nothing
rs.Close
set rs=nothing
set conn=nothing
%>