标题: [求助]代码运行时出现的错误关于语法 [打印本页] 作者: 夜寒 时间: 2010-1-8 03:13 标题: [求助]代码运行时出现的错误关于语法 错误类型:
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")
另外
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
你写的这2个判断条件 应该不管什么时候都为 真 的
是不是想验证变量是否为空
如 : If Trim(Request("ysms")) <> "" Then