在server sql中调试通过的sql语句为什么在asp中无法运行?

anneyang 2001-03-17 10:34:00
sql语句如下:
SELECT reportinfo.title AS title, username.username AS username
FROM reportindex, reportinfo, username
WHERE reportindex.readflag = 1 AND reportindex.root = 203161409 AND
reportindex.reportid = reportinfo.infoid AND reportindex.userid = username.id

在asp中的错误提示如下:
ADODB.Recordset 错误 '800a0bb9'

The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
...全文
170 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
anneyang 2001-03-23
  • 打赏
  • 举报
回复
我终于发现问题所在了.
原来不能用root做变量名.
tripofdream 2001-03-21
  • 打赏
  • 举报
回复
僅這一部分看不出來有什么問題.
anneyang 2001-03-21
  • 打赏
  • 举报
回复
我的程序如下:
TADOQuery中的SQL为:
SELECT reportindex.root AS root, reportinfo.title AS title, reportinfo.rcontent AS rcontent,
reportindex.reportdate AS reportdate, username.username AS username
FROM reportindex, reportinfo, username
WHERE reportindex.readflag = 1 AND reportindex.root=:root AND
reportindex.reportid = reportinfo.infoid AND reportindex.userid = username.id
其中reportindx.root为integer.
程序部分如下:
root integer;
root:=Request.QueryFields.Values['reportid'];
Queryanswer.Parameters.ParamByName('root').Value:=root;//在这条语句中出了问题

请高手帮忙改正.
canbo 2001-03-21
  • 打赏
  • 举报
回复
root:=Request.QueryFields.Values['reportid'];'这是什么意思,在ASP2。0里只有 REQUEST。QUERYSTRING("")还有AND reportindex.root=:root AND
这个好像有错吧。
Queryanswer.Parameters.ParamByName('root').Value:=root'queryanswer是什么对像?
其后的value:=root好像不懂得 ,我也不懂,解决了不要忘了告诉我一声。

tripofdream 2001-03-20
  • 打赏
  • 举报
回复
你的Connection和Recordset都沒有問題嗎?
苛子 2001-03-17
  • 打赏
  • 举报
回复
server sql中调试通过的sql语句为什么在asp中无法运行?
作  

因为SQL SERVER中可以以忽略单引号而 ASP中则不能
所以会提示类型出错

28,406

社区成员

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

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