ADODB.Recordset 错误 '800a0bb9' 急

zjs1109 2009-04-06 02:44:04
ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

/newsview.asp,行 52


--------------------------------------------
<%
sql="select top 6 * from article where Title like '%" + session("Key") + "%' order by Id Desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn_access,1,1
if not rs.eof then
do while not rs.eof
%>

红体为52行。article 表字段

key 为文本
ID为自动编号
...全文
79 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
shxhark 2011-01-12
  • 打赏
  • 举报
回复
这个问题我也遇到了,一模一样!太奇怪了!
madelaop5566 2009-04-07
  • 打赏
  • 举报
回复
4楼可行
zjs1109 2009-04-06
  • 打赏
  • 举报
回复

Microsoft VBScript 运行时错误 错误 '800a005e'
无效使用 Null: 'Replace'

/qmxk2/newsview.asp,行 51

sy_binbin 2009-04-06
  • 打赏
  • 举报
回复
用replace替换一下吧
hookee 2009-04-06
  • 打赏
  • 举报
回复
sKey = session("Key")
sKey = Replace(sKey, "'", "''")
sKey = Replace(sKey, """", """""")
sql = "select top 6 * from [article] where [Title] like '%" & sKey & "%' order by Id Desc"
zjs1109 2009-04-06
  • 打赏
  • 举报
回复
请高手赐教,ASP+ACCESS。中
一个表。字段为文本,查询语句
sql="select top 6 * from article where Title like '%" + session("Key") + "%' order by Id Desc"

其中:session("Key") 如果内容无双引号,则正确
内容包含双引号,就不行


此问题答了给分
sy_binbin 2009-04-06
  • 打赏
  • 举报
回复
你数据库连接的代码呢
发上来看看
zjs1109 2009-04-06
  • 打赏
  • 举报
回复
快哭了

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧