首页 新闻 会员 周边

查询表达式语法错误,请教

0
悬赏园豆:100 [待解决问题]

这是网站日志中的信息:
10:41:59 W3SVC1056449345 116.255.229.170 GET /index.asp |41|80040e14|语法错误_(操作符丢失)_在查询表达式 _'SecondID_=__And_ClassType_=_3_And_State_=_1'_中。 80 - 183.39.180.93 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+Trident/4.0;+.NET+CLR+2.0.50727;+Zune+4.7;+SE+2.X+MetaSr+1.0) 500 0 0

然后我到index.asp文件中看了下
<DIV id=focus>
<%
Dim rdsPic

set rdsPic = Server.CreateObject("ADODB.Recordset")
rdsPic.Open "Select * From Dat_Index_Pic Where PhotoNames Like '%,"& Session("intCityKey") &",%' Order By ListNum",Conn,1,1
if not rdsPic.eof then
%>
<DIV id=focus_text>
这是40-48的语句 找了半天没看到哪儿语法错了,求解答

sheepdog的主页 sheepdog | 初学一级 | 园豆:102
提问于:2013-08-29 18:06
< >
分享
所有回答(3)
0
"Select * From Dat_Index_Pic Where PhotoNames Like '%,"& Session("intCityKey") &",%' Order By ListNum"

看标红的那个变量,你最好输出看下,这个有错误~应该是[]吧~

幻天芒 | 园豆:37175 (高人七级) | 2013-08-29 18:49

人家是asp程序,vb代码,哪有中括号。

 

支持(0) 反对(0) kylin.chen | 园豆:983 (小虾三级) | 2013-08-29 21:21

@kylin.chen: 哦,不过看错误信息,查询表达式 _'SecondID_=__And_ClassType_=_3,出问题的只能是这个Session了~

支持(0) 反对(0) 幻天芒 | 园豆:37175 (高人七级) | 2013-08-29 22:42
1

rdsPic.Open "Select * From Dat_Index_Pic Where PhotoNames Like '%,"& Session("intCityKey") &",%'

去掉百分号旁边的逗号。

rdsPic.Open "Select * From Dat_Index_Pic Where PhotoNames Like '%"& Session("intCityKey") &"%'

kylin.chen | 园豆:983 (小虾三级) | 2013-08-29 22:01
0

response.write  "Select * From Dat_Index_Pic Where PhotoNames Like '%,"& Session("intCityKey") &",%' Order By ListNum"  写弄出查询语句,在数据库里直接查询看报错在哪

瑾秀年华 | 园豆:202 (菜鸟二级) | 2013-08-30 08:11

有试过但是输出之后发现和报错的选择语句完全没关系

支持(0) 反对(0) sheepdog | 园豆:102 (初学一级) | 2013-09-02 17:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册