|
这个程序运行无错,但就是不能更新数据库的记录,为什么呀,急用呀
<!--#include file="conn.asp" -->
<%set rs=server.createobject("adodb.recordset") %>
<%
name=request("name1")
pwd1=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
rs.close
set rs=nothing
sql="update admin set admin_pwd='"&pwd1&"' where (admin_name='"&name&"' and admin_pwd='"&pwd1&"')"
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
%> |
|