帮我看看这段ASP登陆代码哪错了?

来源:百度知道 编辑:UC知道 时间:2024/06/01 13:08:05
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/1/classlogin.asp, 第 17 行
denglu.asp
<form name="form1" method="post" action="classlogin.asp">
<label>用户号
<input type="text" name="zhanghao" size="15">
</label>

<p>
<label>密码<input type="text" name="mima" size="15">
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="提交" />
</label>
</p>
connection.asp
<%
connstr="driver={SQL Server};server=(local);database=xyl"%>
set conn=Server.Createobject("adodb.connection")
conn.open connstr
%>
yanzheng.asp
<!--#include file=connection.asp -->
<%
userid =trim(Request.form(&

connection.asp
<%
connstr="PROVIDER=SQLOLEDB;DATA SOURCE=(local);UID=sa;PWD=;DATABASE=xyl"
set conn=Server.Createobject("adodb.connection")
conn.open connstr
%>
yanzheng.asp
<!--#include file=connection.asp -->
<%
userid =trim(Request.form("zhanghao"))

password =trim(Request.form("mima"))

if userid="" then
response.redirect "error.asp?info=对不起,用户名不能为空,请重新输入!"
else
set rs = createobject("ADODB.recordset")

sql="select * from user where id='"&userid&"' and mima='"&password&"'"
rs.open SQL,conn,1,1
if rs.bof or rs.eof then
response.redirect "error.asp?info=对不起,用户名或密码不正确,请重新输入!"
else
response.redirect "gq.asp"
end if
rs.close
end if

%>

有没有测试一下,,,连接数据库是不是有问题!!!

cla