SQL 代码出错了.

来源:百度知道 编辑:UC知道 时间:2024/06/05 20:07:05
id1=rst("id")
sql2="select * from fs_gbook where qid="&id1&""
rst2.open sql2,cnn,1,3 (提示这行少了一个'')
高手帮我看看为什么会出现错误,SQL语句出现了哪里的问题.
完整的代码:

dim rst2,sql2,id1

For i = 0 To rst.Fields.Count - 1
next
While Not rst.EOF And rowCount < rst.PageSize
uname=rst("name")
id1=rst("id")
sql2="select * from fs_gbook where qid="&id1&""
rst2.open sql2,cnn,1,3
改了也没有用啊.
错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/gbook.asp, 第 79 行

gbook.asp, 第 79 行
检查gbook.asp,缺少对象,
rst2.open sql2,cnn,1,3 是不是rst2.open sql2,conn,1,3 啊
把gbook.asp贴出来

select * from fs_gbook where qid="&id1&""
这里你的字符串是2个双引号不对的
要改成外面双引号
里面单引号
你试试看

sql2="select * from fs_gbook where qid='&id1&'"

----------------------
错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/gbook.asp, 第 79 行
这应该是asp问题,不是存储过程问题了!检查页面代码~