搜索问题,在线等!Microsoft JET Database Engine 错误 '80040e07'

来源:百度知道 编辑:UC知道 时间:2024/05/01 21:14:51
rs.open sql,conn,1,1 这里是出错的地方 行 125
出错提示为Microsoft JET Database Engine 错误 '80040e07'
标准表达式中数据类型不匹配。

以下为SQL语句
<%
function mainsql(submitok,keyname,age,photo2,kind,sex)'sql变量查询
dim a,sql,fstr,agekind
fstr="select username,sex,kind,grade,alltime,click,aboutus,photo_x,photo_d,photo_x_flag,photo_d_flag,regtime,refresh_time,flag from love_main order by refresh_time desc,regtime desc,grade desc"
If submitok="a" Then'按用户名搜
a=trim(replace(keyname,"'","''"))
fstr="select username,sex,kind,grade,alltime,click,aboutus,photo_x,photo_d,photo_x_flag,photo_d_flag,regtime,refresh_time,flag from love_main where flag<>'0' and username like '%"&a&"%' order by refresh_time desc,regtime desc,grade desc"
Elseif submitok="b" Then
fstr="select username,sex,kind,grade,alltime,click,aboutus,photo_x,photo_d,photo_x

80040e07 -- 条件表达式中数据类型不匹配
当服务器尝试处理包含"插入记录"或"更新记录"服务器行为的页面,并且该服务器行为试图将 Microsoft Access 数据库中"日期/时间"列的值设置为空字符串 ("") 时,会出现此错误。

Microsoft Access 具有强数据类型;对于给定的列值有一套严格的规则。SQL 查询中的空字符串值不能存储在 Access"日期/时间"列中。目前已知的唯一解决方法,是避免将空字符串 ("") 或其它任何与该数据类型的指定值范围不对应的值插入 Access 中的"日期/时间"列,也不要使用这些值更新"日期/时间"列。