灵魂救星2ETERNY:怎样处理在vb中的数据库查询问题

来源:百度文库 编辑:高考问答 时间:2024/05/01 19:25:14
如果要查询某个字段值为空的记录,应该怎杨写代码,比如Data1.Recordset.Fields("货品名称").Value = Null 这样写怎么不行呢?请高手指教

select * from 表 where 字段 is null
代码判断的话就是
Data1.Recordset.Fields("货品名称").Value = DBNull

If .Recordset.Fields("照片") <> "" Then
If Dir$(.Recordset.Fields("照片"), vbDirectory) <> "" Then
Image1.Picture = LoadPicture(.Recordset.Fields("照片"))
img1 = .Recordset.Fields("照片")
Else
Image1.Picture = LoadPicture()
End If
Else
Image1.Picture = LoadPicture()
End If

data1.recordsource="selecdt * from 数据库名 where 货品名称= null"