救命。。。ASP语法错误,请帮忙看看哦。20分救命

来源:百度知道 编辑:UC知道 时间:2024/06/04 12:51:19
Set rst=server.CreateObject("adodb.recordset")
if autohostdb then
sqlt="select * from [holiday] where stopday1<'"&date()&"' and stopday2>'"&date()&"'"'服务器上用sqlt="select * from [holiday] where stopday1<'"&now()&"' and stopday2>'"&now()&"'"
else
sqlt="select * from [holiday] where cdate(stopday1)<'"&now&"' and cdate(stopday2)>'"&now&"'"
end if
rst.open sqlt,conn,1,2
if rst.recordcount>0 then
'现在是假期中
actionqq=true
rst.close
set rst=nothing
end if

[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。可能是变量错了。我找了好久没发现
感谢你们,stopday1是日期/时间类型的,数据库是没有问题的,以前的只要改一下代码就好了,好久都忘记了,大家帮帮忙哇。
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e07'

[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。

qqhost.as

楼主的数据库中stopday1类型是什么?

sqlt="select * from [holiday] where cdate(stopday1)<'"&now&"' and cdate(stopday2)>'"&now&"'"

改成:

sqlt="select * from [holiday] where cdate(stopday1)<now() and cdate(stopday2)>now()"

看看

错误是什么贴出来下

可能就是所有的stopday1或是cdate(stopday1)数据类型不正确,你在看下