asp高手指教

来源:百度知道 编辑:UC知道 时间:2024/05/30 11:16:50
<td><%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from huodong where datestart<" & "#" & now()& "# and dateend>#" &now() & "# "&"",conn,1,1 (显示这一句话有错误:从rs.open到conn.1.1)
if rs.eof and rs.bof then
response.write "此优惠活动不存在"
else
do while not rs. eof
%>

错误类型:
Microsoft JET Database Engine (0x80040E07)
日期的语法错误 在查询表达式 'datestart<#2009-7-14 下午 03:34:00# and dateend>#2009-7-14 下午 03:34:00#' 中。

为什么要带上#号啊 你是要实现什么,不妨说出来
而且日期这个东西是不是要加个单引号啊楼主

这什么啊,你可以写完sql,然后下面做个判断,if ***<>now() then

rs.open "select * from huodong datestart<'" & now()& "' and dateend>'" &now() & "'",conn,1,1