注册 登录
编程论坛 ASP技术论坛

获取字段中为空的内容[已解决,呵呵]

anjincheng 发布于 2008-06-11 12:31, 690 次点击
老师们:
    我想查询表中为"空"的内容,我是下面写的,但是错了,怎么改呀?谢谢!
表名:A
字段:B

<%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from A where X = "&trim(request("XX"))&" and B = " ""
rs.open sql,conn,1,1
%>

[[it] 本帖最后由 anjincheng 于 2008-6-11 13:12 编辑 [/it]]

[[it] 本帖最后由 anjincheng 于 2008-6-11 15:06 编辑 [/it]]

[[it] 本帖最后由 anjincheng 于 2008-6-11 15:07 编辑 [/it]]

[[it] 本帖最后由 anjincheng 于 2008-6-11 15:32 编辑 [/it]]
6 回复
#2
hmhz2008-06-11 12:39
B=''
#3
anjincheng2008-06-11 13:13
呵呵!看来小细节我得加强咯!
感谢老师!
#4
anjincheng2008-06-11 15:05
不行呀老师们
写上去以后不管怎么查都没有数据(但是不提示错误了)
#5
hmhz2008-06-11 15:22
X='"&trim(request("XX"))&"' and B=''
#6
anjincheng2008-06-11 15:33
老师:我知道是这样的,但是确实不行
我只有用 B IS NULL了

感谢!
#7
zhangyao32872008-06-11 15:43
B=''是用在字符串类型的字段里的
1