这个程序最后总出错,各位大仙帮帮忙纠正一下,非常感谢!!

sunnyccc0000 2009-08-31 08:54:04
<!--#include file="conn.asp"-->
<html>
<head>
<title>验证</title>
</head>
<body>
<%
userID=Trim(request("ID"))
userPassword=Trim(request("password"))
E-mail=Trim(request("e-mail"))
If(ID=""or Password=""or E-mail="")Then
response.write"用户名或密码或邮箱不能为空"
response.Redirect(index.asp)
response.End
end if
Dim strsql,rs
strsql="select * from user where username='"&user_id&"'"
strsql=strsql&"and password='"&user_pasw&"'"
strsql=strsql&"and email='"&user_email&"'"
set conn=server.CreateObject("adodb.connection")
conn.open"mydata"
set rs=conn.execute("strsql")
if not rs.eof then
response.Write("用户名已经存在")
response.Redirect(index.asp)
response.End
if rs.eof then
rs.AddNew
rs("user_name")=request("username")
rs("user_password")=request("userpwd")
rs("user_email")=request("E_mail")
rs.update
response.Write("用户添加成功!")
end if
set rs=nothing
set conn=nothing

%>
</body>
</html>

运行出错:
错误类型:
Microsoft VBScript 编译器错误 (0x800A03F6)
缺少 'End'
/xitong/Login.asp, 第 36 行
...全文
119 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
不耐烦 2009-08-31
  • 打赏
  • 举报
回复
第一个
0 默认游标类型, 为打开向前游标, 只能在记录集中向前移动.
1 打开键集类型的游标, 可以在记录集中向前或向后移动. 如果其他用户修改或删除了一条记录, 记录集中将反映这个变化. 但是, 如果其他用户添加了一条新记录, 新记录不会出现在记录集中.
2 打开动态游标, 可以在记录集中向前或向后移动. 其他用记造成的记录的任何变化都将在记录集中有所反映.
3 打开静态游标, 可以在记录集中向前或向后移动. 但是, 静态游标不会对其他用户造成的记录变化有所反映.
第二个是
1 只读锁定, 指定不能修改记录集中的记录.
2 保护式锁定, 指在编辑一个记录时, 立即锁定它.
3 开放式锁定, 指定只有调用记录集的 Update() 方法时才能锁定记录.
4 开放式批锁定, 指定记录只能成批地更新.
最常用的两种方法:
rs.open sql,conn,1,1 '读取显示数据时用,只读
rs.open sql,conn,1,3 '更新或插入数据时用,读写
不耐烦 2009-08-31
  • 打赏
  • 举报
回复
可读 可写
sunnyccc0000 2009-08-31
  • 打赏
  • 举报
回复
rs.Open strsql, conn, 1, 3

1和3代表什么意思啊
sumjor 2009-08-31
  • 打赏
  • 举报
回复
1楼 正解
lbcleo 2009-08-31
  • 打赏
  • 举报
回复
楼上正解
hookee 2009-08-31
  • 打赏
  • 举报
回复

<!--#include file="conn.asp"-->
<html>
<head>
<title>验证 </title>
</head>
<body>
<%
userID=Trim(request("ID"))
userPassword=Trim(request("password"))
E-mail=Trim(request("e-mail"))
If(userID=""or userPassword=""or E-mail="")Then
response.write"用户名或密码或邮箱不能为空"
response.End
end if
Dim strsql,rs
strsql="select * from user where username='"&userID&"'"
strsql= strsql & " and password='"&userPassword&"'"
strsql=strsql & " and email='"&E-mail&"'"
set conn=server.CreateObject("adodb.connection")
conn.open "mydata"
set rs = CreateObject("ADODB.RecordSet")
rs.Open strsql, conn, 1, 3
if not (rs.eof And rs.Bof) then
response.Write("用户名已经存在")
response.End
else
rs.AddNew
rs("username")=userID
rs("password")=userPassword
rs("email")=E-mail
rs.update
response.Write("用户添加成功!")
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</body>
</html>

28,409

社区成员

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

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