刚学ASP不久,遇到一个难题,如下是输入一个值在ACCESS数据库里查找的代码,执行下来都是提示:“对不起,没有您要查询的记录!”,但是其实有些是确实存在应该能查出来的,请高手赐教。万分感激。
<!--#include file="conn.asp" -->
<%
dim keyword1,keyword2,day22
keyword1=trim(request("key1"))
keyword2=trim(request("key2"))
typeid1=request("type1")
typeid2=request("manager1")
day22=request("day2")+ 1
starttime=trim(request("year1"))+"-"+trim(request("month1"))+"-"+trim(request("day1"))
endtime=trim(request("year2"))+"-"+trim(request("month2"))+"-"+trim(day22)
%>
<%
dim kdphone
dim sql
kdphone=request("bphone")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Content1 where phone like '%"&kdphone&"%' and ReceiveDate <= # " & endtime & " # and ReceiveDate>= # " & starttime & " # order by ID desc"
rs.open sql,conn,1,1
if rs.eof then
response.write "<p align='center'>对不起,没有您要查询的记录!</p>"
end if
%>
请教代码执行不成功的原因