asp多条件查询报错
大侠帮忙看看错在哪里,错误类型:MicrosoftVBScript编译器错误(0x800A0401)语句未结束/xh.asp,line32,column33sql=sql...
大侠帮忙看看错在哪里,
错误类型:
Microsoft VBScript 编译器错误 (0x800A0401)
语句未结束
/xh.asp, line 32, column 33
sql=sql & "and Bearing_C like '%"&hd&"%'"
<!--#include file="Connections/Modellist.asp" -->
<%
Bearing_NewModel=Request.Form("Bearing_NewModel")
nj=Request.Form("nj")
wj=Request.Form("wj")
hd=Request.Form("hd")
%>
<div name="hxqsj" aline="center">
<table border="0" width="100%">
<tr>
<td width="8%">姓名</td>
<td width="8%">地址</td>
<td width="8%">电话</td>
<td width="8%">QQ</td>
</tr>
</table>
</div>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from BearingModels where 1=1"
if Bearing_NewModel<>"" then
sql=sql & "and Bearing_NewModel like '%"&Bearing_NewModel&"%' "
end if
if nj<>"" then
sql=sql & "and Bearing_d like '%"&nj&"%' "
end if
if wj<>"" then
sql=sql & "and Bearing_DDiameter like '%"&wj&"%'"
end if
if hd<>"" then
sql=sql & "and Bearing_C like '%"&hd&"%'"
end if
sql=sql & " order by id "
rs.open sql,conn,1,1
Do While Not rs.eof
%>
<div name="hxqsj" aline="center">
<table border="0" width="100%">
<tr>
<td width="8%"><%=rs("Bearing_NewModel")%></td>
<td width="8%"><%=rs("nj")%></td>
<td width="8%"><%=rs("wj")%></td>
<td width="8%"><%=rs("hd")%></td>
</tr>
</table>
</div>
<%
rs.movenext
Loop
rs.close
set rs=nothing
set conn=nothing
%> 展开
错误类型:
Microsoft VBScript 编译器错误 (0x800A0401)
语句未结束
/xh.asp, line 32, column 33
sql=sql & "and Bearing_C like '%"&hd&"%'"
<!--#include file="Connections/Modellist.asp" -->
<%
Bearing_NewModel=Request.Form("Bearing_NewModel")
nj=Request.Form("nj")
wj=Request.Form("wj")
hd=Request.Form("hd")
%>
<div name="hxqsj" aline="center">
<table border="0" width="100%">
<tr>
<td width="8%">姓名</td>
<td width="8%">地址</td>
<td width="8%">电话</td>
<td width="8%">QQ</td>
</tr>
</table>
</div>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from BearingModels where 1=1"
if Bearing_NewModel<>"" then
sql=sql & "and Bearing_NewModel like '%"&Bearing_NewModel&"%' "
end if
if nj<>"" then
sql=sql & "and Bearing_d like '%"&nj&"%' "
end if
if wj<>"" then
sql=sql & "and Bearing_DDiameter like '%"&wj&"%'"
end if
if hd<>"" then
sql=sql & "and Bearing_C like '%"&hd&"%'"
end if
sql=sql & " order by id "
rs.open sql,conn,1,1
Do While Not rs.eof
%>
<div name="hxqsj" aline="center">
<table border="0" width="100%">
<tr>
<td width="8%"><%=rs("Bearing_NewModel")%></td>
<td width="8%"><%=rs("nj")%></td>
<td width="8%"><%=rs("wj")%></td>
<td width="8%"><%=rs("hd")%></td>
</tr>
</table>
</div>
<%
rs.movenext
Loop
rs.close
set rs=nothing
set conn=nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询