关于查询!

VFP 2002-07-25 02:24:48
出错提示:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC driver does not support the requested properties.

/1/duo_cx_jg.asp, 行44

<!--#include file="dbconn.inc" -->
<%xm=trim(request("xm"))
condition=""
rq1=""
if xm <> "" then condition=" 姓名->"&xm&" "
nian=trim(request("nian"))
yue=trim(request("yue"))
ri=trim(request("ri"))
if nian <> "" then
rq=nian
rq1=nian&"年"
end if
if yue <> "" then
rq=rq&"-"&yue
rq1=rq1&yue&"月"
end if
if ri <> "" then
rq=rq&"-"&ri
rq1=rq1&ri&"日"
end if
if rq1 <> "" then condition=condition&"日期->"&rq1&" "
session("name")=name
session("rq")=rq
session("condition")=condition
%>
.......
<%
sql="select * from b where xm like '%"&session("xm")&"%' and convert(char,sj,21) like '%"&session("rq")&"%'"
set rs=server.createobject("adodb.recordset") <--------44行就在此
rs.open sql,conn,1,1
%>

请问错在哪?(ACCESS数据库)日期和姓名联合查询。
...全文
38 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
VFP 2002-07-25
  • 打赏
  • 举报
回复
出错提示:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC driver does not support the requested properties.

/1/duo_cx_jg.asp, 行44

怎么解决?
blackcatiii 2002-07-25
  • 打赏
  • 举报
回复
日期为什么不用datetime类型?
看能否在asp里CDate了
if rq<>"" then
if not isDate(rq) then
response.write "日期格式不正确"
response.end
end if
rq=CDate(rq)
end if
session("rq")=rq
cmsoft 2002-07-25
  • 打赏
  • 举报
回复
sql="select * from b where xm like '%"&session("xm")&"%' and sj like '%"&session("rq")&"%'"
response.write sql
response.end
输出SQL,在ACCESS里执行一下
cmsoft 2002-07-25
  • 打赏
  • 举报
回复
sql="select * from b where xm like '%"&session("xm")&"%' and sj like '%"&session("rq")&"%'"
response.write sql
response.end
输出SQL,在ACCESS里执行一下

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧