日期:2014-05-17  浏览次数:20860 次

语法错误 (操作符丢失) 在查询表达式 'news_id=' 中。
<%
news_id=trim(request( "news_id "))
set   rs=server.CreateObject( "adodb.recordset ")
sql= "select   *   from   news   where   news_id= "   &clng(news_id)
rs.open   sql,conn,1,1
if   rs.eof   then
response.write "错误的ID号 "
rs.close
set   rs=nothing
conn.close
set   conn   =   nothing
response.end
eles
%>
提示我错误类型:
Microsoft   JET   Database   Engine   (0x80040E14)
语法错误   (操作符丢失)   在查询表达式   'news_id= '   中。


请高手指点   '

------解决方案--------------------
<%
news_id=trim(request( "news_id "))
if news_id= " " then news_id=0
set rs=server.CreateObject( "adodb.recordset ")
sql= "select * from news where news_id= " &clng(news_id)
rs.open sql,conn,1,1
if rs.eof then
response.write "错误的ID号 "
rs.close
set rs=nothing
conn.close
set conn = nothing
response.end
eles
%>