Checking for Null Database Values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vayse

    Checking for Null Database Values

    i want to check if the following field is null.

    Dim rsAssets As New ADODB.Recordset

    rsAssets.Fields ("SubIcon").Val ue)

    IsNull is no longer supported, so what should I use?

    Thanks

    Vayse




  • Al Reid

    #2
    Re: Checking for Null Database Values

    "Vayse" <Vayse@nospam.n ospam> wrote in message news:O%23%23knj QvFHA.3400@TK2M SFTNGP14.phx.gb l...[color=blue]
    > i want to check if the following field is null.
    >
    > Dim rsAssets As New ADODB.Recordset
    >
    > rsAssets.Fields ("SubIcon").Val ue)
    >
    > IsNull is no longer supported, so what should I use?
    >
    > Thanks
    >
    > Vayse
    >
    >[/color]

    Try IsDbNull().

    --
    Al Reid


    Comment

    • Vayse

      #3
      Re: Checking for Null Database Values

      Thats it, thanks.


      "Al Reid" <areidjr@reidDA SHhome.com> wrote in message
      news:uy$z5rQvFH A.3756@tk2msftn gp13.phx.gbl...[color=blue]
      > "Vayse" <Vayse@nospam.n ospam> wrote in message
      > news:O%23%23knj QvFHA.3400@TK2M SFTNGP14.phx.gb l...[color=green]
      >> i want to check if the following field is null.
      >>
      >> Dim rsAssets As New ADODB.Recordset
      >>
      >> rsAssets.Fields ("SubIcon").Val ue)
      >>
      >> IsNull is no longer supported, so what should I use?
      >>
      >> Thanks
      >>
      >> Vayse
      >>
      >>[/color]
      >
      > Try IsDbNull().
      >
      > --
      > Al Reid
      >
      >[/color]


      Comment

      • Pipo

        #4
        Re: Checking for Null Database Values

        Convert.DBNull

        "Vayse" <Vayse@nospam.n ospam> wrote in message
        news:O%23%23knj QvFHA.3400@TK2M SFTNGP14.phx.gb l...[color=blue]
        > i want to check if the following field is null.
        >
        > Dim rsAssets As New ADODB.Recordset
        >
        > rsAssets.Fields ("SubIcon").Val ue)
        >
        > IsNull is no longer supported, so what should I use?
        >
        > Thanks
        >
        > Vayse
        >
        >
        >
        >[/color]


        Comment

        • Al Reid

          #5
          Re: Checking for Null Database Values

          Not quite. Convert.DBNull is a constant representing "database null" while Convert.IsDBNul l() is the test for it.

          --
          Al Reid

          "Pipo" <NoSpam@me.co m> wrote in message news:OA5Co5QvFH A.3400@TK2MSFTN GP14.phx.gbl...[color=blue]
          > Convert.DBNull
          >
          > "Vayse" <Vayse@nospam.n ospam> wrote in message
          > news:O%23%23knj QvFHA.3400@TK2M SFTNGP14.phx.gb l...[color=green]
          > > i want to check if the following field is null.
          > >
          > > Dim rsAssets As New ADODB.Recordset
          > >
          > > rsAssets.Fields ("SubIcon").Val ue)
          > >
          > > IsNull is no longer supported, so what should I use?
          > >
          > > Thanks
          > >
          > > Vayse
          > >
          > >
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: Checking for Null Database Values

            "Al Reid" <areidjr@reidDA SHhome.com> schrieb:[color=blue]
            > Not quite. Convert.DBNull is a constant representing "database null"
            >while Convert.IsDBNul l() is the test for it.[/color]

            However, you could use 'If ... Is DBNull.Value Then...' instead of
            'IsDBNull'.

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://classicvb.org/petition/>

            Comment

            • Pipo

              #7
              Re: Checking for Null Database Values

              if rsAssets.Fields ("SubIcon") = convert.dbnull then

              end if
              "Al Reid" <areidjr@reidDA SHhome.com> wrote in message
              news:ep$qt$QvFH A.1252@TK2MSFTN GP09.phx.gbl...[color=blue]
              > Not quite. Convert.DBNull is a constant representing "database null"[/color]
              while Convert.IsDBNul l() is the test for it.[color=blue]
              >
              > --
              > Al Reid
              >
              > "Pipo" <NoSpam@me.co m> wrote in message[/color]
              news:OA5Co5QvFH A.3400@TK2MSFTN GP14.phx.gbl...[color=blue][color=green]
              > > Convert.DBNull
              > >
              > > "Vayse" <Vayse@nospam.n ospam> wrote in message
              > > news:O%23%23knj QvFHA.3400@TK2M SFTNGP14.phx.gb l...[color=darkred]
              > > > i want to check if the following field is null.
              > > >
              > > > Dim rsAssets As New ADODB.Recordset
              > > >
              > > > rsAssets.Fields ("SubIcon").Val ue)
              > > >
              > > > IsNull is no longer supported, so what should I use?
              > > >
              > > > Thanks
              > > >
              > > > Vayse
              > > >
              > > >
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Pipo

                #8
                Re: Checking for Null Database Values

                Thanks Herfried,

                That was what I meant.

                "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                news:OAFXePRvFH A.3720@TK2MSFTN GP14.phx.gbl...[color=blue]
                > "Al Reid" <areidjr@reidDA SHhome.com> schrieb:[color=green]
                > > Not quite. Convert.DBNull is a constant representing "database null"
                > >while Convert.IsDBNul l() is the test for it.[/color]
                >
                > However, you could use 'If ... Is DBNull.Value Then...' instead of
                > 'IsDBNull'.
                >
                > --
                > M S Herfried K. Wagner
                > M V P <URL:http://dotnet.mvps.org/>
                > V B <URL:http://classicvb.org/petition/>
                >[/color]


                Comment

                Working...