anjincheng 发表于 2008-6-11 12:31

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

老师们:
    我想查询表中为"空"的内容,我是下面写的,但是错了,怎么改呀?谢谢!
表名: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]]

hmhz 发表于 2008-6-11 12:39

B=''

anjincheng 发表于 2008-6-11 13:13

呵呵!看来小细节我得加强咯!
感谢老师!

anjincheng 发表于 2008-6-11 15:05

不行呀老师们
写上去以后不管怎么查都没有数据(但是不提示错误了)

hmhz 发表于 2008-6-11 15:22

X='"&trim(request("XX"))&"' and B=''

anjincheng 发表于 2008-6-11 15:33

老师:我知道是这样的,但是确实不行
我只有用 B IS NULL了

感谢!

zhangyao3287 发表于 2008-6-11 15:43

B=''是用在字符串类型的字段里的

页: [1]

编程论坛