Microsoft JET Database Engine 错误 '80040e14'
Microsoft JET Database Engine 错误 '80040e14'
多余的 ) 在查询表达式 'IsSelected=True and (ChannelID=-1 or ChannelID=) and (ShowType=0 or ShowType=1) and (OutTime=0 or OutTime>DateDiff('d',DateAndTime, Now()))' 中。
/Include/PowerEasy.Common.Front.asp,行 638
帮忙看下哪里有问题。
源码:
If AnnounceNum > 0 And AnnounceNum <= 10 Then
sqlAnnounce = "select top " & AnnounceNum
Else
sqlAnnounce = "select top 10"
End If
If ContentLen < 0 Then
ContentLen = 100
End If
sqlAnnounce = sqlAnnounce & " * from PE_Announce where IsSelected=" & PE_True & " and (ChannelID=-1 or ChannelID=" & ChannelID & ") and (ShowType=0 or ShowType=1) and (OutTime=0 or OutTime>DateDiff(" & PE_DatePart_D & ",DateAndTime, " & PE_Now & ")) order by ID Desc"
Set rsAnnounce = Conn.Execute(sqlAnnounce)
------解决方案--------------------如果 ChannelID 是数值 类型,检查是否为空。