毛瑟98k步枪重量:我的网页中修改密码为什么说Update格式不对???

来源:百度文库 编辑:高考问答 时间:2024/05/06 02:54:19
这是我找的一段修改密码的代码
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.OleDb"%>
<%
if session("usename")<>"" then
if request.Form("submit")<>"" and request.Form("zhanghao")<>"" and request.Form("submit")<>"" and request.Form("mima")<>"" then
dim conn as new OleDbConnection
dim comm1 as new OleDbCommand
dim dr as OleDbDataReader
dim sql
conn.connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\web\data\blog.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
conn.open
comm1.connection=conn
sql="select * from YH where yhname='" & request.Form("zhanghao") & "' and yhpass='" & request.Form("mima") & "'"
comm1.commandtext=sql
dr=comm1.executeReader
if dr.read=true then
conn.close
conn.open
sql="update YH set yhpass='" & request.Form("xmima") & "'"
comm1=new oledbcommand(sql,conn)
comm1.executeNonQuery
response.Write("<script language=javascript>alert('修改成功!');location.href='default.aspx';</script>")
else
response.Write("<script language=javascript>alert('用户不存在!')</script>")
conn.close
end if
end if
else
response.Redirect("default.aspx")
end if
%>

da xiao xie