注册 登录
编程论坛 ASP技术论坛

密码修改老是不成功,求指点,哪里错了呀

尽在天涯 发布于 2013-07-04 19:07, 572 次点击
<!--#include file=conn.asp-->
<html>
<body bgcolor=#clf7d8>
<center>
<%
dim oldpassword,newpassword,confirmpassword
dim strwhere,rs,sql,changesql
oldpassword=request.form("oldpassword")
newpassword=request.form("newpassword")
confirmpassword=request.form("confirmpassword") '10
if oldpassword=""or newpassword=""then
response.write("请输入密码")
%>
<a href=javascript:history.back()><br>返回</a>
<%
response.end
end if
if newpassword<>confirmpassword then
response.write("两次密码不相同")
%> '20
<a href=javascript:history.back()><br>返回</a>
<%
response.end
end if

strwhere="where user_name='"&session("user_name")&"'and pwd='"&oldpassword&"'"
sql="select * from user_reg_42914"&strwhere
changesql="update user_reg_42914 set pwd='&newpassword&'"&strwhere
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3 '30
%>
<br>
<%
if rs.recordcount=1 then
set changers=server.createobject("adodb.recordset")
changers.open changesql,conn,1,3
set changers=nothing
response.write("密码修改成功")
%>
<a href="http://localhost/user.asp"><br>返回用户界面</a>
<%
else
response.write("密码输入错误,无法修改")
%>
<a href=javascript:history.back()><br>返回</a>
<%
end if
rs.close
set rs=nothing
%>
</body></html>



Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]'=' 附近有语法错误。

/changepwd1.asp,行 30
2 回复
#2
hu9jj2013-07-05 07:12
很可能是你的SQL代码不正确,重点检查一下。
#3
tf09042013-07-05 09:53
SQL 语句 你自己response 出来看 应该是where 之前少一个空格
1