sqlserver 数据asp修改 高分寻求解决办法300分 http://expert.csdn.net/Expert/topic/1564/1564803.xml?temp=.6016657 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <%session("userid")=userid%><%session("userpwd")=userpwd%> <!--#include file="dbconn.inc"--><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>修改密码</title><style type="text/css">td{font-size:9pt}a:link,a:visited,a:actived{text-decoration:underline;color="#0000ff"}a:hover{text-decoration:underline;color="#ff0000"}</style></head> <%userid=request("userid")userpwd=request("userpwd")sql="select * from t_kfqy_user where userid='"+userid+"' and userpwd='"+userpwd+"'"rs.open sql, conn, 3%><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table border="0" width="776" cellspacing="0" cellpadding="0" align="center" > <tr> <td width="100%" style="padding-left: 30px"> <br/> <form name="form1" method="post" action="editpwdsave.asp?userid=<%=rs("userid")%>"> <table border="0" width="618" cellspacing="1" cellpadding="4" style="border-left: medium none; border-right: medium none; border-top: 1px none rgb(255,188,155); border-bottom: 1px none rgb(255,255,255); margin-left: 16px; margin-top: 10px; padding-left: 4px" bgcolor="#120506" align="center"> <tr bgcolor="#FFFFFF"> <td height="30" colspan="2"> <div align="center"> <center> <p><font color="#FFFFFF"><b><font color="#FFFFFF"><b><font color="#000000">修改</font></b></font><font color="#000000">密码</font></b></font> </center> </div> </td> </tr> <tr> <td width="107" height="30" bgcolor="#FFFFFF" align="center"> <div align="left"> <p><font color="#000000">用户名:</font> </div> </td> <td width="492" height="30" bgcolor="#FFFFFF" align="center"> <div align="left"> <p><font color="#000000"> <%=rs("userid")%> </font> </div> </td> </tr> <tr> <td width="107" height="30" bgcolor="#FFFFFF" align="center"> <div align="left"> <p><font color="#FF0000">*<font color="#000000">新</font></font><font color="#000000">密码:</font> </div> </td> <td width="492" height="30" bgcolor="#FFFFFF" align="center"> <div align="left"> <p> <input type="password" name="userpwd" size="30"> </div> </td> </tr> <tr> <td width="107" height="30" bgcolor="#FFFFFF" align="center"> <div align="left"> <p><font color="#FF0000">*</font><font color="#000000">确认密码:</font> </div> </td> <td width="492" height="30" bgcolor="#FFFFFF" align="center"> <div align="left"> <p> <input type="password" name="pwd_c" size="30"> </div> </td> </tr> <tr> <td height="30" bgcolor="#FFFFFF" colspan="2" align="center"> <div align="left"> <p align="center"> <input type="submit" value="修 改" name="submit" style="font-size: 9pt"> <input type="reset" value="清 除" name="q" style="font-size: 9pt"> </div> </td> </tr> </table> </form> <p align="center"> </td> </tr></table></body></html>editsave.asp -------------------><!--#include file="dbconn.inc"--><html><head><title>修改密码 </title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">p,td,div{font-size:9pt}</style></head><%userid=request("userid") userpwd=request("userpwd") pwd_c=request("pwd_c") sql="update t_kfqy_user set userpwd='"+userpwd+"',pwd_c='"+pwd_c+" where userid='"+userid&"'" set rs=conn.execute(sql) %><body bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000"><p> </p><table border="0" width="200" cellspacing="0" cellpadding="0" style="padding-left: 10px" align="center"> <tr> <td width="100%" style="padding-left: 30px"><font color="#FF0000" size="+1">修改成功!<br/> <br/> <a href="#" onclick="window.history.go(-1)">点击这里返回!</a></font></td> </tr></table></body></html> pengdali(大力) 不行呀,内部服务器错误ASP连接Sqlserver数据库语句 添加在头部吗? 1.输入新密码的页面-------------------------------------------------<%Option Explicit%><html><head><title>输入新密码</title><script language="javascript">function submitok(){var pwdissamepwdissame = trueif((document.changePwd.pwd1.value == "")&&pwdissame){alert("密码不能为空!")pwdissame = false}if((document.changePwd.pwd2.value == "")&&pwdissame){alert("请确认密码!")pwdissame = false}if((document.changePwd.pwd1.value != document.changePwd.pwd2.value)&&pwdissame){alert("两次密码不匹配!")pwdissame = false}return pwdissame}</script></head><body><form name="changePwd" action="SaveNewPwd.asp" method="post" onsubmit="return submitok()"><input type="hidden" name="username" value="<% =request.form("username")%>"><input type="hidden" name="oldpassword" value="<% =request.form("password")%>">请输入新密码:<input type="password" name="pwd1"><br/>请重复新密码:<input type="password" name="pwd2"><br/><input type="submit" value="提交"></form></body>2.处理页面SaveNewPwd.asp------------------------------------------<%Option Explicitdim conn,DBPathdim rs_userdim sqldim username,oldpassword,password1 username =left(request("username"),10) oldpassword =left(request("password"),10) password1 = request.form("password1") '-----------------创建数据库连接----------------Set conn = Server.CreateObject("ADODB.Connection")DBPath = Server.MapPath("wangmi.mdb")conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath'------------------修改密码----------------------conn.execute "update user_reg set password = '"&password1&"' where username='"&username&"' and password='"&oldpassword&"'"%>---------------------完成--------------------到asp版去问吧!这是SQL版!!! 关于账户权限设置问题 一个统计报表,难度很大,请高手解决 如何使一个表的一些字段不能被修改?急 能不能把这两个SQL查询合成一句?效率高更好! 请教一SQL 数据库并发控制的问题 请教如何查看数据表中每个字段的描述?? 新!新!新!update触发器的问题! 远程建表的问题! 有关存储过程的问题请教 SQL SERVER 中报表的打印 各位大虾帮忙给点意见,谢谢
<%session("userpwd")=userpwd%>
<!--#include file="dbconn.inc"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改密码</title>
<style type="text/css">
td{font-size:9pt}
a:link,a:visited,a:actived{text-decoration:underline;color="#0000ff"}
a:hover{text-decoration:underline;color="#ff0000"}
</style>
</head>
<%
userid=request("userid")
userpwd=request("userpwd")
sql="select * from t_kfqy_user where userid='"+userid+"' and userpwd='"+userpwd+"'"
rs.open sql, conn, 3
%>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" width="776" cellspacing="0" cellpadding="0" align="center" >
<tr>
<td width="100%" style="padding-left: 30px">
<br/>
<form name="form1" method="post" action="editpwdsave.asp?userid=<%=rs("userid")%>">
<table border="0" width="618" cellspacing="1" cellpadding="4" style="border-left: medium none; border-right: medium none; border-top: 1px none rgb(255,188,155); border-bottom: 1px none rgb(255,255,255); margin-left: 16px; margin-top: 10px; padding-left: 4px" bgcolor="#120506" align="center">
<tr bgcolor="#FFFFFF">
<td height="30" colspan="2">
<div align="center">
<center>
<p><font color="#FFFFFF"><b><font color="#FFFFFF"><b><font color="#000000">修改</font></b></font><font color="#000000">密码</font></b></font>
</center>
</div>
</td>
</tr>
<tr>
<td width="107" height="30" bgcolor="#FFFFFF" align="center">
<div align="left">
<p><font color="#000000">用户名:</font>
</div>
</td>
<td width="492" height="30" bgcolor="#FFFFFF" align="center">
<div align="left">
<p><font color="#000000"> <%=rs("userid")%> </font>
</div>
</td>
</tr>
<tr>
<td width="107" height="30" bgcolor="#FFFFFF" align="center">
<div align="left">
<p><font color="#FF0000">*<font color="#000000">新</font></font><font color="#000000">密码:</font>
</div>
</td>
<td width="492" height="30" bgcolor="#FFFFFF" align="center">
<div align="left">
<p>
<input type="password" name="userpwd" size="30">
</div>
</td>
</tr>
<tr>
<td width="107" height="30" bgcolor="#FFFFFF" align="center">
<div align="left">
<p><font color="#FF0000">*</font><font color="#000000">确认密码:</font>
</div>
</td>
<td width="492" height="30" bgcolor="#FFFFFF" align="center">
<div align="left">
<p>
<input type="password" name="pwd_c" size="30">
</div>
</td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF" colspan="2" align="center">
<div align="left">
<p align="center">
<input type="submit" value="修 改" name="submit" style="font-size: 9pt">
<input type="reset" value="清 除" name="q" style="font-size: 9pt">
</div>
</td>
</tr>
</table>
</form>
<p align="center">
</td>
</tr>
</table>
</body>
</html>editsave.asp ------------------->
<!--#include file="dbconn.inc"-->
<html>
<head>
<title>修改密码 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
p,td,div{font-size:9pt}
</style>
</head>
<%userid=request("userid")
userpwd=request("userpwd")
pwd_c=request("pwd_c")
sql="update t_kfqy_user set userpwd='"+userpwd+"',pwd_c='"+pwd_c+" where userid='"+userid&"'"
set rs=conn.execute(sql)
%>
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000">
<p> </p><table border="0" width="200" cellspacing="0" cellpadding="0" style="padding-left: 10px" align="center">
<tr>
<td width="100%" style="padding-left: 30px"><font color="#FF0000" size="+1">修改成功!<br/>
<br/>
<a href="#" onclick="window.history.go(-1)">点击这里返回!</a></font></td>
</tr>
</table>
</body>
</html>
<%
Option Explicit
%>
<html>
<head>
<title>输入新密码</title>
<script language="javascript">
function submitok(){
var pwdissame
pwdissame = trueif((document.changePwd.pwd1.value == "")&&pwdissame){
alert("密码不能为空!")
pwdissame = false
}
if((document.changePwd.pwd2.value == "")&&pwdissame){
alert("请确认密码!")
pwdissame = false
}
if((document.changePwd.pwd1.value != document.changePwd.pwd2.value)&&pwdissame){
alert("两次密码不匹配!")
pwdissame = false
}
return pwdissame
}
</script>
</head>
<body>
<form name="changePwd" action="SaveNewPwd.asp" method="post" onsubmit="return submitok()">
<input type="hidden" name="username" value="<% =request.form("username")%>">
<input type="hidden" name="oldpassword" value="<% =request.form("password")%>">请输入新密码:<input type="password" name="pwd1">
<br/>
请重复新密码:<input type="password" name="pwd2">
<br/>
<input type="submit" value="提交">
</form>
</body>
2.处理页面SaveNewPwd.asp------------------------------------------
<%
Option Explicit
dim conn,DBPath
dim rs_user
dim sql
dim username,oldpassword,password1 username =left(request("username"),10)
oldpassword =left(request("password"),10)
password1 = request.form("password1")
'-----------------创建数据库连接----------------
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("wangmi.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath'------------------修改密码----------------------
conn.execute "update user_reg set password = '"&password1&"' where username='"&username&"' and password='"&oldpassword&"'"
%>---------------------完成--------------------
到asp版去问吧!这是SQL版!!!