查找出了问题!帮帮我!
1007 2005-04-07 07:05:17
大家帮我看一下 下边的 程序 那里出错! 如果我不选择 条件的话!没有问题 选择了
条件就出错!帮帮忙!
sql="select * from y_yf where 1=1 order by id desc"
if id<>"" then
sql=sql & " and id=" & id
end if
if ycity<>"不限" then
sql=sql & " and ycity='" & ycity & "'"
end if
if ystyle<>"不限" then
sql=sql & " and ystyle='" & ystyle &"'"
end if
if ymoney<>"不限" then
sql=sql & " and ymoney between " & replace(ymoney,"-"," and ")
end if
if yarea<>"不限" and isnumeric(yarea) then
tmp=cint(yarea)
if tmp>=6 then
sql=sql & " and yarea>=200"
else
sql=sql & " and yarea between " & (tmp-1)*40 & " and " & tmp*40
end if
end if
rs.open sql,cn,3,2
if rs.eof and rs.bof then
————————————
错误提示!
——————————————————————
Microsoft JET Database Engine 错误 '80040e14'
ORDER BY 子句语法错误。
/web_site/new/g_yfcha_ok.asp,行67