DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Null Value in Recordset

  1. #1
    rkbnair Guest

    Null Value in Recordset


    Int_value = rsTest.Fields("Fld1").Value
    Here, if the recordset value is null, I'm getting an error. Is there any
    method using which I can circumvent this error.

    Something like NVL(......) like in Oracle?

    Thanks in advance,

    RK.



  2. #2
    Strider Guest

    Re: Null Value in Recordset

    If not IsNull(rsTest.Fields("Fld1").Value) then
    Int_value = rsTest.Fields("Fld1").Value
    else

    end if

    jc
    rkbnair <rkannale@solus.oceaneering.com> wrote in message
    news:39ca64a5$1@news.devx.com...
    >
    > Int_value = rsTest.Fields("Fld1").Value
    > Here, if the recordset value is null, I'm getting an error. Is there any
    > method using which I can circumvent this error.
    >
    > Something like NVL(......) like in Oracle?
    >
    > Thanks in advance,
    >
    > RK.
    >
    >




  3. #3
    Obi Guest

    Re: Null Value in Recordset


    Try using the IsNull function in VB to ensure if the field contains a null
    value.



    "rkbnair" <rkannale@solus.oceaneering.com> wrote:
    >
    >Int_value = rsTest.Fields("Fld1").Value
    >Here, if the recordset value is null, I'm getting an error. Is there any
    >method using which I can circumvent this error.
    >
    >Something like NVL(......) like in Oracle?
    >
    >Thanks in advance,
    >
    >RK.
    >
    >



  4. #4
    rkbnair Guest

    Re: Null Value in Recordset


    Many Thanks to Strider and Obi

    "Obi" <obi@att.net> wrote:
    >
    >Try using the IsNull function in VB to ensure if the field contains a null
    >value.
    >
    >
    >
    >"rkbnair" <rkannale@solus.oceaneering.com> wrote:
    >>
    >>Int_value = rsTest.Fields("Fld1").Value
    >>Here, if the recordset value is null, I'm getting an error. Is there any
    >>method using which I can circumvent this error.
    >>
    >>Something like NVL(......) like in Oracle?
    >>
    >>Thanks in advance,
    >>
    >>RK.
    >>
    >>

    >



  5. #5
    Sascha Guest

    Re: Null Value in Recordset


    "rkbnair" <rkannale@solus.oceaneering.com> wrote:
    >
    >Int_value = rsTest.Fields("Fld1").Value
    >Here, if the recordset value is null, I'm getting an error. Is there any
    >method using which I can circumvent this error.
    >
    >Something like NVL(......) like in Oracle?
    >
    >Thanks in advance,
    >
    >RK.
    >
    >


    to prevent all the Ifs, do something like:
    Int_value = Val(rsTest.Fields("Fld1").Value)

    hope that helps


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center