注册页出错,帮忙看看

gzf30 2004-12-29 10:02:14
db_conn.asp
<%
set conn = Server.CreateObject("ADODB.Connection")
DBpath=server.MapPath( "../data/ASK20041228.mdb")
Conn.Open "Provider=Microsoft.JET.OLEDB.4.0;" & "Data Source=" & DBpath &";User ID =;Password=;"
%>

register.asp
<!--#include file="../include/db_conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
userid = request("userid")
password = request("password")
response.Write(userid)
response.Write(password)
sql="Insert into test(Name,Password) values('"&userid&"','"&password&"')"
Set rs=conn.Execute("select Name from test where Name='"&userid&"'")
If rs.EOF=false Then
response.Write("用户名已存在")
rs.close
Else
Conn.execute(sql)
Conn.close
End If
%>
</body>
</html>
...全文
110 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
comszsoft 2004-12-29
  • 打赏
  • 举报
回复
错误代码贴出来
comszsoft 2004-12-29
  • 打赏
  • 举报
回复
在sqlserver里 name,password 都是保留字,不知道access有没有,试试看这个

sql="Insert into test([Name],[Password]) values('"&userid&"','"&password&"')"
Set rs=conn.Execute("select Name from test where [Name]='"&userid&"'")
Dreampeng 2004-12-29
  • 打赏
  • 举报
回复
up
comszsoft 2004-12-29
  • 打赏
  • 举报
回复
If rs.EOF=false Then
to
if not rs.eof then
红色银狐 2004-12-29
  • 打赏
  • 举报
回复
支持comszsoft(星星点灯)的说法。。。。。。。。。。
红色银狐 2004-12-29
  • 打赏
  • 举报
回复
到底什么错了。。。。。
香椿炒鸡蛋 2004-12-29
  • 打赏
  • 举报
回复
关键字 在关键字前后加上[]

28,390

社区成员

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

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