错误类型: ADODB.Recordset (0x800A0BB9) 参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突
错误类型:ADODB.Recordset(0x800A0BB9)参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。/addnewdata.asp,第16行代码如...
错误类型: ADODB.Recordset (0x800A0BB9) 参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/addnewdata.asp, 第 16 行
代码如下:
<title>用户注册页面</title>
<!--#include file="Connections/conn.asp" -->
<%
if trim(request("username"))<>"" and trim(request("password"))<>"" then
response.Write"<script language='javascript'>"& "alert('用户名和密码不能为空!');history.go(-1);</script>"
end if
%>
<%
if (len(trim(request("username")))>5) and (len(trim(request("password")))>5) then
else
response.Write"<script language='javascript'>"& "alert('用户名和密码长度不能少于6个字符');history.go(-1);</script>"
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from info where username='"&trim(request("username"))&"' ",conn,1,3
if not (rs.bof and rs.eof) then
rs.close
set rs=close
response.Write"<script language='javascript'>"& "alert('对不起,该用户名已存在!');history.go(-1);</script>"
end if
%>
<%
dim pwd1
pwd1=Request("password")
dim pwd2
pwd2=Request("repassword")
if pwd1<>pwd2 then
rs.close
response.Write"<script language='javascript'>"& "alert('用户密码前后输入不一致!');history.go(-1);</script>"
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from info where username='" & trim(request("username")) & "'",conn,1,3
rs.close
rs.open "select * from info",conn,1,3
rs.addnew
rs("username")=trim(request("username"))
rs("password")=trim(request("password"))
rs("sex")=trim(request("sex"))
rs("E-mail")=trim(request("E-mail"))
rs("company")=trim(request("company"))
rs.update
rs.close
response.Write "恭喜您!"& trim(request("username")) & "注册成功!"
response.Write "<p><a href=index.asp>返回首页</a></p>"
set rs1=nothing
%> 展开
/addnewdata.asp, 第 16 行
代码如下:
<title>用户注册页面</title>
<!--#include file="Connections/conn.asp" -->
<%
if trim(request("username"))<>"" and trim(request("password"))<>"" then
response.Write"<script language='javascript'>"& "alert('用户名和密码不能为空!');history.go(-1);</script>"
end if
%>
<%
if (len(trim(request("username")))>5) and (len(trim(request("password")))>5) then
else
response.Write"<script language='javascript'>"& "alert('用户名和密码长度不能少于6个字符');history.go(-1);</script>"
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from info where username='"&trim(request("username"))&"' ",conn,1,3
if not (rs.bof and rs.eof) then
rs.close
set rs=close
response.Write"<script language='javascript'>"& "alert('对不起,该用户名已存在!');history.go(-1);</script>"
end if
%>
<%
dim pwd1
pwd1=Request("password")
dim pwd2
pwd2=Request("repassword")
if pwd1<>pwd2 then
rs.close
response.Write"<script language='javascript'>"& "alert('用户密码前后输入不一致!');history.go(-1);</script>"
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from info where username='" & trim(request("username")) & "'",conn,1,3
rs.close
rs.open "select * from info",conn,1,3
rs.addnew
rs("username")=trim(request("username"))
rs("password")=trim(request("password"))
rs("sex")=trim(request("sex"))
rs("E-mail")=trim(request("E-mail"))
rs("company")=trim(request("company"))
rs.update
rs.close
response.Write "恭喜您!"& trim(request("username")) & "注册成功!"
response.Write "<p><a href=index.asp>返回首页</a></p>"
set rs1=nothing
%> 展开
2个回答
展开全部
connection/conn.asp
文件里没有定义server.CreateObject("ADODB.Connection")
应该是:
var MM_conn_STRING
set MM_conn_STRING = server.CreateObject("ADODB.Connection")
MM_conn_STRING.open "Driver=;dbq=" & Server.MapPath("/data/Db.mdb")
文件里没有定义server.CreateObject("ADODB.Connection")
应该是:
var MM_conn_STRING
set MM_conn_STRING = server.CreateObject("ADODB.Connection")
MM_conn_STRING.open "Driver=;dbq=" & Server.MapPath("/data/Db.mdb")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询