首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

select * from info_shop where id="&sid&"未结束的字符串常量?解决方法

2012-03-08 
select * from info_shop where id&sid&未结束的字符串常量???select*frominfo_shopwhereid &sid&

select * from info_shop where id="&sid&"未结束的字符串常量???
select   *   from   info_shop   where   id= "&sid& "

我一改这里就变成了未结束的字符串常量,请问兄弟,这是什么回事?


sid= ' "&sid& "与sid= "&sid& "有什么不同?

[解决办法]
sql= "select * from info_shop where id= "&sid
id为数字则不用加引号
为字符串则要加
[解决办法]
字段sid是字符串文字类型的话 "... sid= ' " & sid & " ' "
字段sid是数字类型的话 "... sid= " & sid

热点排行