这是啥原因啊,asp中? ADODB.Recordset (0x800A0CC1) 在对应所需名称或序数的集合中,未找到项目。
access里的字段没对应错代码如下<%ifrequest.form("user")=""orrequest.form("ps")=""thenresponse.redi...
access里的字段没对应错
代码如下
<%
if request.form("user")="" or request.form("ps")="" then
response.redirect "online.asp"
end if
dim user,ps
user= trim(request.form("user"))
ps = trim(request.form("ps"))
Dim conn,strConn
Set conn=Server.CreateObject("ADODB.Connection")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb")
conn.Open strConn
Dim rs,strSql
Set rs=Server.CreateObject("ADODB.Recordset")
strSql ="Select * From userinfo where name='" & user & "'and pwd='" & ps & "'"
Set rs=conn.Execute(strSql)
if rs.eof then
response.redirect "online.asp"
else
response.write "登录成功"
end if
end if
%> 展开
代码如下
<%
if request.form("user")="" or request.form("ps")="" then
response.redirect "online.asp"
end if
dim user,ps
user= trim(request.form("user"))
ps = trim(request.form("ps"))
Dim conn,strConn
Set conn=Server.CreateObject("ADODB.Connection")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb")
conn.Open strConn
Dim rs,strSql
Set rs=Server.CreateObject("ADODB.Recordset")
strSql ="Select * From userinfo where name='" & user & "'and pwd='" & ps & "'"
Set rs=conn.Execute(strSql)
if rs.eof then
response.redirect "online.asp"
else
response.write "登录成功"
end if
end if
%> 展开
3个回答
展开全部
strSql ="Select * From userinfo where name='" & user & "'and pwd='" & ps & "'"
问题出在了name='" & user & "'and 这里,and 前面没有空格
你改成
strSql ="Select * From userinfo where name='" & user & "' and pwd='" & ps & "'"
应该就没有问题了
问题出在了name='" & user & "'and 这里,and 前面没有空格
你改成
strSql ="Select * From userinfo where name='" & user & "' and pwd='" & ps & "'"
应该就没有问题了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如果确定表名,字段名都没错的话,将
strSql ="Select * From userinfo where name='" & user & "'and pwd='" & ps & "'"
改为
strSql ="Select * From userinfo where [name]='" & user & "' and pwd='" & ps & "'"
strSql ="Select * From userinfo where name='" & user & "'and pwd='" & ps & "'"
改为
strSql ="Select * From userinfo where [name]='" & user & "' and pwd='" & ps & "'"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
字段名错了,仔细检查一下,还有想楼上说的name是关键字用[]括起来
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询