我要修改现有记录,但是…………
我要修改现有的一条记录,但是我只能修改最后一条记录。而不能修改其他的,如果修改就会提示数据库引擎出错。大家看看哪里错了?
<%@ LANGUAGE="VBSCRIPT" %>
<%if session("name")="" then
Response.Redirect "../default.htm"
end if
dim conn
dim rs
dim strcnn
Set Conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.recordset")
StrCnn = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../data/data.mdb")
Conn.Open StrCnn
dim errorString
dim pName
dim pNickname
dim pSex
dim pBirthday
dim pQQ
dim pIcq
dim pEmail
dim pTel
dim pHomepage
dim pText
dim pAddress
dim pPostNO
dim pPassword
dim pRepassword
dim sql
pNickname=trim(Request.Form("txtnickname"))
pSex=trim(Request.Form("txtsex"))
pName=trim(Request.Form("txtname"))
pBirthday=trim(Request.Form("txtbirthday"))
pQQ=trim(Request.Form("txtQQ"))
pIcq=trim(Request.Form("txticq"))
pEmail=trim(Request.Form("txtemail"))
pTel=trim(Request.Form("txttel"))
pHomepage=trim(Request.Form("txthomepage"))
pText=trim(Request.Form("txttext"))
pPostNO=trim(Request.Form("txtpostNO"))
pPassword=trim(Request.Form("txtPassword"))
pRepassword=trim(Request.Form("txtRepassword"))
pAddress=trim(Request.Form("txtAddress"))
errorString=""
%>
<html>
<head>
<title>Lucky7同学录</title>
<link rel="stylesheet" type="text/css" href="../include/white.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="275"><img src="../images/top.gif" width="280" height="60"></td>
<td><A HREF=http://asiafriendfinder.com/go/p103828 target=_top>
<img src=http://banners.asiafriendfinder.com/banners/ffz/gb05.gif
width=468 height=60 border=0></A></td>
</tr>
</table>
<div align="center">
<p>
<%
if not (pPassword=pRepassword) then
errorString="“密码”与“重复密码”不同。"
end if
if pPassword="" then
errorString="密码不能为空。"
end if
if pPostNO="" then
errorString="邮政编码不能为空。"
end if
if pAddress="" then
errorString="通信地址不能为空。"
end if
if pIcq="" then
errorString="ICQ号码不能为空,如果没有请添0。"
end if
if pQQ="" then
errorString="QQ号码不能为空,如果没有请添0。"
end if
if not isdate(pBirthday) then
errorString="你输入的生日不是日期,请按"&date&"的格式输入。"
end if
if pBirthday="" then
errorString="生日不能为空。"
end if
if pSex="" then
errorString="性别不能为空。"
end if
if pName="" then
errorString="姓名不能为空。"
end if
%>
<%if not errorString="" then%>
<table width="50%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td>你填写的资料有如下错误:<b><%=errorString%></b>请重新填写。</td>
</tr>
<tr>
<td>
<div align="right"><img src="../images/link.gif" width="18" height="18" align="absmiddle"><a href="javascript:history.back();">确定>></a><img src="../images/link.gif" width="18" height="18" align="absmiddle"><a href="../main.asp">返回首页>></a></div>
</td>
</tr>
</table>
<%else%>
<%sql="select * from members where 姓名='" & pName &"'"
rs.open sql,conn,1,3
rs("姓名")=pName
rs("昵称")=pNickname
rs("性别")=pSex
pBirthday=cdate(pBirthday)
pQQ=clng(pQQ)
pIcq=clng(pIcq)
rs("生日")=pBirthday
rs("QQ号码") =pQQ
rs("ICQ号码")=pIcq
rs("电子邮件地址")=pEmail
rs("电话")=pTel
rs("个人主页")=pHomepage
rs("通信地址")=pAddress
rs("邮政编码")=pPostNO
rs("备注")=pText
rs("密码")=pPassword
rs("登陆日期")=Date
rs.Update
rs.Clone
set rs=nothing
conn.Close
set conn=nothing
session("name")=pName
%>
<table width="50%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td>你填写的资料已经修改成功,请返回。</td>
</tr>
<tr>
<td>
<div align="right"><img src="../images/link.gif" width="18" height="18" align="absmiddle"><a href="../main.asp">返回首页>></a></div>
</td>
</tr>
</table>
<%end if%>
</body>
</html>