错误类型:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
第 1 行: '>' 附近有语法错误。
/xiaoxippzyh/test3/out.asp, 第 21 行
下面是代码:
<!--#include file="include/config.asp"-->
<!--#include file="include/conn.asp"-->
<%
dim rs,strsql,searchstr
dim data1,data2
data1=request("year1")&"-"&request("month1")&"-"&request("day1")
data2=request("year2")&"-"&request("month2")&"-"&request("day2")
searchstr="where date=>'" & data1 &"' and data<='" & data2 & "'" '
if trim(request("ysms"))<>" " then
searchstr=searchstr& "and mode='" & trim(request("ysms"))&"'"
end if '"and mode='" "'"不懂
if trim(request("name"))<>" " then
searchstr=searchstr & " and (company like '%" & trim(request("name")) & "%')"
end if
strSql="select * from [database1] " & SearchStr & " order by id desc" '
set rs=server.createobject("adodb.recordset")
rs.open strsql,conn,3,3
response.write strsql
response.end
%>
<html >
<head>
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="621" height="53" border="1" align="center">
<%do while rs.eof%>
<tr>
<td width="83" bgcolor="#A6D2FF">到达日期</td>
<td width="83" bgcolor="#A6D2FF">运输模式</td>
<td width="86" bgcolor="#A6D2FF">公司</td>
<td width="42" bgcolor="#A6D2FF">数量</td>
<td width="67" bgcolor="#A6D2FF">联系人</td>
<td width="147" bgcolor="#A6D2FF">联系电话</td>
<td width="67" bgcolor="#A6D2FF">是否到达</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><%rs="date"%></td>
<td bgcolor="#FFFFFF"><%rs="u_ysms"%></td>
<td bgcolor="#FFFFFF"><%rs="u_companyname"%></td>
<td bgcolor="#FFFFFF"><%rs="u_number"%></td>
<td bgcolor="#FFFFFF"><%rs="u_name"%></td>
<td bgcolor="#FFFFFF"><%rs="u_tel"%></td>
<td bgcolor="#FFFFFF"><%rs="u_select"%></td>
</tr>
<%rs.movenext
loop
rs.close()
set rs=nothing
%>
</table>
</form>
</body>
</html>
<!--#include file="include/connclose.asp"-->
希望能指出错误在哪里,该怎么改?
顺便再问下
searchstr=searchstr& "and mode='" & trim(request("ysms"))&"'"
用到的引号是什么作用,我总是看不明白