SELECT 子句中包含一个保留字、拼写错误或丢失的参数,或标点符号不正确--解决

北京不不 2005-05-05 09:05:56
titles=request.form("titles")
shuoming=request.form("shuoming")
banzhu=request.form("banzhu")
call openconn()
sql="insert into luntan_bankuai([title],[shuoming],[banzhu]) values('"&title&"','"&shuoming&"','"&banzhu&"')"
sqls="select from luantan_bankuai where titles="&titles
response.write sqls
set rs=conn.execute(sqls)
if not rs.eof then
response.write"<script language=""javascript"">alert(""版块标题已存在,请更换"");</script>"
else
call conn.execute(sql)
response.write"<script language=""javascript"">alert(""版块添加成功"");</script>"
end if
call closeconn()
set rs=nothing

运行后

select from luantan_bankuai where titles=生活琐事
Microsoft JET Database Engine 错误 '80040e14'

SELECT 子句中包含一个保留字、拼写错误或丢失的参数,或标点符号不正确。

/csmr/luntan/luntan_list_send.asp,行13
...全文
304 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chengzhen2005 2005-05-06
  • 打赏
  • 举报
回复
insert into语句必须要求写满数据表中的所有字段,而且必须按照顺序赋值,你丢下任何一个都不行,我想你的数据表中不可能只有这三个字段吧.你好好检查一下吧,我的解决方案是从实践中来的,你试试吧,
freshui 2005-05-06
  • 打赏
  • 举报
回复
insert into 不见得吧,如果允许字段为空是可以的,一般我出了id,其他都允许空的
jzywh 2005-05-05
  • 打赏
  • 举报
回复
select from luantan_bankuai where titles
?

语法错误


select * from


或者 select 字段列表 from ..
qiqunet 2005-05-05
  • 打赏
  • 举报
回复



我也来试试::)



sqls="select * from luantan_bankuai where titles='" & titles & "'"






freshui 2005-05-05
  • 打赏
  • 举报
回复
select from luantan_bankuai where titles="&titles
??
你要select what? 这样吧

select * from luantan_bankuai where titles="&titles
北京不不 2005-05-05
  • 打赏
  • 举报
回复
回freshui(五月的风) 我拉下了个S 加上不过也没用..我就纳闷了..
freshui 2005-05-05
  • 打赏
  • 举报
回复
title这个是关键字?我的能用啊... 这个问题吧

titles=request.form("titles")
values('"&title&"','"&shuoming&"','"&banzhu&"')"

一个有s 一个没有加s

qiqian_17 2005-05-05
  • 打赏
  • 举报
回复
select from luantan_bankuai where titles="生活琐事"
看看行不行

28,406

社区成员

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

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