用户名注册重复的问题

huhacoca 2010-09-13 10:03:09
if rs.eof and not rs.bof then
Rs.addnew
Rs("username")=request.Form("username")
Rs("password")=request.Form("psd1")
Rs("address")=request.Form("address")
Rs("tel")=request.Form("tel")
Rs("contact")=request.Form("contact")
Rs("content")=request.Form("content")
Rs("companyname")=request.Form("select")
Rs("time")=now()
Rs.update
Rs.Close
conn.close
Set Rs=nothing
set conn=nothing
response.write("<script language=javascript> alert('注册成功!');window.location.href='login.asp';</script>")
else
response.write("<script language=javascript> alert('用户名重复!');window.location.href='reg.asp';</script>")
end if


改过很多次了,不是可以一直重复添加,就是一直提示用户名重复。。。
求正确的写法
...全文
74 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqm05 2010-09-13
  • 打赏
  • 举报
回复
if rs.eof and rs.bof then
不耐烦 2010-09-13
  • 打赏
  • 举报
回复
if rs.eof and not rs.bof then

改成

if rs.eof and rs.bof then
hookee 2010-09-13
  • 打赏
  • 举报
回复
判断没记录的话用 rs.eof and rs.bof
if rs.eof and rs.bof then
....
Rs.update
end if

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧