asp与access连接问题2?
做网页时出现错误:ADODB.Recordset (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/asp/ljw/newuseradd.asp, 第 91 行
我代码是:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% option explicit
dim name,tel,addr,email,zip,pw1,pw2,temp
dim founderr,errmsg
founderr=false
temp=request.Form("yonghuname")
name=request.Form("name")
if name="" then
founderr=true
errmsg="姓名不能为空!"
end if
pw1=request.Form("password1")
pw2=request.Form("password2")
if(pw1="" or pw1<>pw2) then
founderr=true
errmsg=errmsg & "密码错误!"
end if
tel=request.Form("tel")
if tel="" then
founderr=true
errmsg=errmsg & "联系电话不能为空!"
end if
addr=request.Form("addr")
if addr="" then
founderr=true
errmsg=errmsg & "联系地址不能为空!"
end if
email=request.Form("email")
if email="" then
founderr=true
errmsg=errmsg & "e-mail不能为空!"
end if
zip=request.Form("zip")
if zip="" then
founderr=true
errmsg=errmsg & "邮编不能为空!"
end if
if founderr then
response.Write errmsg%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<p class="font">为了我们更好的为您服务,更准确及时地将您订购的商品送到您的手中并与您联系,请您务必详细填写您的信息,并核对无误;国内用户请留下您的真实中文姓名。<br>请放心:您的资料未经您的允许,我们将只用于处理您的订货信息,对外保密。<font face="Arial, Helvetica, sans-serif">(</font>带<font color="#ff0000"><strong><span class="main2">*</span></strong></font><span class="16v"><font color="#000080">号为必添项<font face="Arial, Helvetica, sans-serif">)</font></font></span></p>
<form method="post" action="usercheck.asp">
<p><table border="1" cellpadding="1" cellspacing="1" width="318" align="center">
<tr>
<td class="font" width="74">用户名</td>
<td width="228"><%=temp%><input type="hidden" name="yonghuname" value="<%=temp%>"></td>
</tr>
<tr>
<td class="font" width="74">姓名<font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="text" name="name" size="20"></td>
<tr>
<td class="font" width="74">密码:<font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="password" name="password1" size="20"></td>
</tr>
<tr>
<td class="font" width="74">确认密码:<font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="password" name="password2" size="20"></td>
<tr>
<td class="font" width="74">联系电话: <font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="text" name="tel" size="20"></td>
<tr>
<td class="font" width="74">联系地址: <font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="text" name="addr" size="20"></td>
<tr>
<td class="font" width="74">E-mail: <font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="text" name="email" size="20"></td>
<tr>
<td class="font" width="74">邮编: <font color="#ff0000"><strong><span class="main2">*</span></strong></font></td>
<td width="228"><input type="text" name="zip" size="20"></td>
</table>
<p align="center"><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>
</body>
</html>
<%else
dim connstr,conn,rs,sql
connstr="dbq="+server.MapPath("mdb/shop.mdb")+";defaultdir=;driver={microsoft access driver (*.mdb)};"
set conn=server.CreateObject("adodb.connection")
conn.Open connstr
set rs=server.CreateObject("adodb.recordset")
sql="select * from guest"
rs.Open sql,conn,3,3
if rs.EOF=true then
rs.MoveLast
end if
rs.addnew
rs("yonghuname")=temp
rs("name")=name
rs("password")=pw1
rs("tel")=tel
rs("addr")=addr
rs("zip")=zip
rs("email")=email
rs.Update
rs.close
conn.close
set conn=nothing
set rs=nothing
%>
<script language="javascript">
alert("已经成功添加了一条记录!谢谢!")
document.location="main.asp"
</script>
<% end if%>