Null Value


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Null Value

  1. #1
    John Knoop Guest

    Null Value

    Try this:

    If isnull(rs("ExtPrice1")) Then
    'some code that should get executed
    End If

    or
    If isempty(rs("ExtPrice1")) Then
    'some code that should get executed
    End If

    I haven't tried it, but I think it should work.

    -----Ursprungligt meddelande-----
    Från: Eric Lindros [mailto:nobody@nobody.com]
    Anslaget den: den 15 november 2000 14:30
    Anslaget i: asp
    Konversation: Null Value
    Ämne: Null Value


    How do you test for a Null value in a returned recordset from SQL Server
    7?

    I have tried the following, with no luck:

    If (rs("ExtPrice1") = NULL) Then
    'some code that never gets executed
    End If

    What is the proper way to do this?

    I have also tried all of the following:

    If (rs("ExtPrice1") = "NULL") Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = null) Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = "null") Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = Nothing) Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = "") Then
    'some code that never gets executed
    End If



  2. #2
    Eric Lindros Guest

    Re: Null Value

    Thank you very much. Worked perfectly!!
    David
    "John Knoop" <john@wedoweb.nu> wrote in message
    news:9445E7E81450D4119D0D00062945A3C1021A40@R2D2...
    > Try this:
    >
    > If isnull(rs("ExtPrice1")) Then
    > 'some code that should get executed
    > End If
    >
    > or
    > If isempty(rs("ExtPrice1")) Then
    > 'some code that should get executed
    > End If
    >
    > I haven't tried it, but I think it should work.
    >
    > -----Ursprungligt meddelande-----
    > Från: Eric Lindros [mailto:nobody@nobody.com]
    > Anslaget den: den 15 november 2000 14:30
    > Anslaget i: asp
    > Konversation: Null Value
    > Ämne: Null Value
    >
    >
    > How do you test for a Null value in a returned recordset from SQL Server
    > 7?
    >
    > I have tried the following, with no luck:
    >
    > If (rs("ExtPrice1") = NULL) Then
    > 'some code that never gets executed
    > End If
    >
    > What is the proper way to do this?
    >
    > I have also tried all of the following:
    >
    > If (rs("ExtPrice1") = "NULL") Then
    > 'some code that never gets executed
    > End If
    >
    > If (rs("ExtPrice1") = null) Then
    > 'some code that never gets executed
    > End If
    >
    > If (rs("ExtPrice1") = "null") Then
    > 'some code that never gets executed
    > End If
    >
    > If (rs("ExtPrice1") = Nothing) Then
    > 'some code that never gets executed
    > End If
    >
    > If (rs("ExtPrice1") = "") Then
    > 'some code that never gets executed
    > End If
    >
    >




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