ASPSQL语句至少一个参数没有被指定值。

来源:百度知道 编辑:UC知道 时间:2024/09/28 11:19:02
M的字段能传过来值,但是只要一传过来的时候就提示至少一个参数没有被指定值。
wylx=trim(request("wylx"))
area=trim(request("area"))
M=trim(request("M"))
select2=trim(request("select2"))
select3=trim(request("select3"))
set rs=server.createobject("adodb.recordset")
sql="select * from u_Product_Name_All_View where pro_type_id=4 "
if area<>"" then
sql=sql & " and pro_areas Like '%"&area&"%'"
end if
wylx<>"" then
sql=sql & " and pro_hx like '%"&wylx&"%'"
end if
if M<>"" then
sql=sql & " and M like '%"& M &"%'"
end if
if select2<>"" then
sql=sql & " and pro_lc between '"& select2 &"' and '"& select3 &"'"
end if
sql=sql & " order by pro_date desc "
re

你可以在这个地方输出M,sql语句,把sql语句放到数据库中看看
就这段话看不出来什么错误,你再个个字段都输出看看能不能发现问题

连接的时候要加空格,你在and 前边加个空格试试