xiaoxippzyh/test3/out.asp, 第 21 行

来源:百度知道 编辑:UC知道 时间:2024/05/16 12:32:04
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(&qu

data1=request("year1")&"-"&request("month1")&"-"&request("day1")
data2=request("year2")&"-"&request("month2")&"-"&request("day2")

下面加2行:
data1=cdate(data1)
data2=cdate(data2)

Microsoft OLE DB Provider for SQL Server (0x80040E14)

ACCESS才需要在日期旁加#;MSSQL是'没错!

searchstr="where date=>'" & data1 &"' and data<='" & data2 & "'"
SQL语句: 条件=DATE字段在 DATA1和DATA2中间

strSql="select * from [database1] " & SearchStr & " order by id desc" '为什么这样加searchstr?
根据上面的条件判断 生成的SQL条件语句where也不一样

set rs=nothing 'set是数据库语言?什么时候要关闭rs
SET建立对象
对象使用完毕后 关闭对象 释放内存