读书人

急ADODB.Recordset 异常 800a0bb9

发布时间: 2012-02-07 17:45:36 作者: rapoo

急!!!ADODB.Recordset 错误 '800a0bb9'
代码:
<% ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '新留言提示
dim newgbook
If request.Cookies( "love ")( "username ") <> " " and request.Cookies( "love ")( "password ") <> " " Then '刚注册,不能登录
set rs=Server.CreateObject( "ADODB.recordset ")
rs.open "select username,new from love_gbook where username= ' "&request.Cookies( "love ")( "username ")& " ' and new=1 ",conn,1,1 //此行提示出错
if not rs.bof and not rs.eof then '找到记录
newgbook=1
end if
rs.close
End if

出错提示:
ADODB.Recordset 错误 '800a0bb9 '

参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。



[解决办法]
在open前输出你的sql字符串看看
response.write "select username,new from love_gbook where username= ' "&request.Cookies( "love ")( "username ")& " ' and new=1 "
[解决办法]
and new= '1 '
[解决办法]
if rs.eof then....
[解决办法]
为空也不应试出现这种错误呀,

建议放到数据库里运行试试看

或者你包含conn进来没有?

读书人网 >ASP

热点推荐