text ntext image 不支持 <> '' 或 = ''服务器: 消息 306,级别 16,状态 1,行 1 不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。
可以尝试在程序中使用错误控制试一下在VB中为例: on error goto errdesif len(rs("textname")) then else 'text 不为null,但为'' end iferrexit: exit sub errdes: if err.number="the error number" then '表示text为null,具体的数目不记得了,但是可以查到 else end if resume errexit
try: where (fieldname is not null) and (len(fieldname) =0 )
用DATALENGTH函数,这个函数可以显示任意类型的数据的长度SELECT * FROM TABLENAME WHERE DATALENGTH(ISNULL(TEXTPTR(你的TEXT自字段名),'H'))=0TEXTPTR函数是判断TEXT等大型数据类型的指针的,用ISNULL去掉那些为NULL的纪录。
不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。
on error goto errdesif len(rs("textname")) then
else
'text 不为null,但为''
end iferrexit:
exit sub
errdes:
if err.number="the error number" then '表示text为null,具体的数目不记得了,但是可以查到
else
end if
resume errexit
where (fieldname is not null) and (len(fieldname) =0 )