一个简单的问题。。帮忙看看

gezhou 2003-09-19 11:28:41
gkey=request.querystring("key")
if gkey=1 then
response.redirect "delu.htm"
response.end
else
sql="select * from cp where id=" & gkey
set rs=server.CreateObject("adodb.recordset")
set rs.activeconnection=conn
rs.open sql,conn,1,1
当gkey=1 时正常 反之则出现
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft JET Database Engine 错误 '80040e14'

语法错误 (操作符丢失) 在查询表达式 'id=' 中。

/jin/ding/dd21.asp,行19
怎么了这是
...全文
23 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
coffee_cn 2003-09-19
  • 打赏
  • 举报
回复
sql="select * from cp where id=" & gkey
response.write sql

他的值 gkey没有得到吧
ljupin 2003-09-19
  • 打赏
  • 举报
回复
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
gkey这个值可能是空值
Brookes 2003-09-19
  • 打赏
  • 举报
回复
gkey=request.querystring("key")没有值
ljupin 2003-09-19
  • 打赏
  • 举报
回复
gkey=request.querystring("key")
if gkey=1 then
response.redirect "delu.htm"
response.end
else
sql="select * from cp where id=" & gkey
set rs=server.CreateObject("adodb.recordset")
set rs.activeconnection=conn
rs.open sql,conn,1,1

End if '少了这句
gezhou 2003-09-19
  • 打赏
  • 举报
回复
没人理我?
xanewong111 2003-09-19
  • 打赏
  • 举报
回复
gkey = request.querystring("key")
if gkey = "1" then '这里加上引号,用字符串的形式
response.redirect "delu.htm"
response.end
else

set rs=server.CreateObject("adodb.recordset")
sql="select * from cp where id = " & gkey
rs.open sql,conn,1,1


End if


set rs.activeconnection=conn 这行没什么用,去掉就是了
gezhou 2003-09-19
  • 打赏
  • 举报
回复
gkey 的值传过来了 用response.write 试过了
超级大笨狼 2003-09-19
  • 打赏
  • 举报
回复
conn你还没连接上没open 呢

28,391

社区成员

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

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