请问下面哪里错了~

swhrzl 2002-08-01 08:25:06
<%
dim sql
dim rs
dim seekerrs
dim founduser
dim CardId
dim companyid
dim password
dim errmsg
dim founderr
founderr=false
FoundUser=false
CardId=trim(request("CardId"))
password=cstr(Request("password"))

set rs=server.createobject("adodb.recordset")
sql="select * from userlist where CardId="& CardId &""
rs.open sql,conn,3,3 (这里是19行)
if not(rs.bof and rs.eof) then
if password=rs("password") and CardId=rs("CardId") then
response.cookies("CardId")=true
response.redirect "userhome.asp"
else
response.write "<link rel='stylesheet' type='text/css' href='css/style.css'>"
response.write "<body bgcolor='#ffffff'>"
response.write "您输入的用户名和密码不对,请输入正确的名字和密码,方可进入管理页面"
end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
/xlwb/usergoin.asp, 第 19 行
请帮帮忙`~~~谢谢~~~`
...全文
5 点赞 收藏 7
写回复
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
tripofdream 2002-08-01
0x80040E10错误一般是SQL语句出错,如果CardId是字符型,后面要加"'".
回复
jedy 2002-08-01
把你的sql用response.write sql看一下
回复
apple749769 2002-08-01
sql="select * from userlist where CardId="& CardId &""

==>>

sql="select * from userlist where CardId='"& CardId &"'"
回复
MeXP 2002-08-01
conn在何处定义的?
回复
MeXP 2002-08-01
conn在何处定义的?
回复
huayuxing 2002-08-01
sql="select * from userlist where CardId="& CardId &""
cardID是文本的话
sql="select * from userlist where CardId='"& CardId & "'"
回复
MeXP 2002-08-01
<%
founderr=false 'founderr和foundUser好像没用
FoundUser=false
CardId=trim(request("CardId"))
password=trim(Request("password"))

set rs=server.createobject("adodb.recordset")
sql="select * from userlist where CardId="& CardId &" and password='"&password&"'"
rs.open sql,conn,3,3 (这里是19行)
if not rs.eof then
response.cookies("CardId")=true
response.redirect "userhome.asp"
else
response.write "<link rel='stylesheet' type='text/css'

href='css/style.css'>"
response.write "<body bgcolor='#ffffff'>"
response.write "您输入的用户名和密码不对,请输入正确的名字和密码,方可进入管

理页面"
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
数据库中cardID是否定义为字符串?如果是加单引号。这样修改不好吗.你试一试
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告