我的数据库中有
id    name  photo三个字段分别储存
编号、姓名、照片
类型分别为自动编号、文本和OLE
现在我想列出所有有照片的记录,我想应该是这样
If not 11111.fields(2)=null then
   列出所有的记录
end if但是在运行的时候会报错。各位DX,应该怎样做这个判断?谢谢!

解决方案 »

  1.   

    If not 11111.fields(2) is null then
       列出所有的记录
    end if或
    If not isnull(11111.fields(2)) then
       列出所有的记录
    end if
      

  2.   

    If not isnull(11111.fields(2)) then
       列出所有的记录
    end if
    上面的代码好像检索出了所有的记录
    也就是说,photo字段中有内容和没有内容的都检索出来了,还是报错……
      

  3.   

    if isnull(rs!pic) then
      .......
    else
      ......
    end if
      

  4.   

    if isnull(rs.fields("pic").value)=true then
      .......
    else
      ......
    end if