如何判断rs(1)的值是布尔类型或者是空

解决方案 »

  1.   

    直接对recordset操作是不好的,个人的建议是这样的不管是为空还是什么形态。先这样
    dim strRst as string
    strRst=Trim(rs(1) &"")
    if strRst="" then
       msgbox "为空"
    else
       '如果只是为空或者为true or false是好办,你可以去判断下就是了
    end if
      

  2.   

    判断一个变量的类型可以用VarType 函数,到MSDN中看去。
      

  3.   

    If rs.Fields(1).Type = adBoolean Then
          Msgbox "Boolean Type"
    Else
       If IsNull(rs.Fields(1)) Then
          Msgbox "Null"
       End If
    End If