Results 1 to 3 of 3

Thread: Invalid use of NULL

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    5

    Smile

    hi,
    I hope someone finds this a simple problem and can provide a quick resolution....

    I am creating a recordset from an Oracle DB. Then i am moving that data into labels on a form for viewing only by the user. the problem is when i encounter a field from the DB that is null the error comes up:
    Invalid use of NULL - runtime error '94'.

    is there a way to let the label just display a blank?

    or do i have to ensure that the DB has no nulls in it? that seems kinda extreme to me.

    hope you can help!

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    You should enforce No Nulls in any database anyway since you might understand tri-state logic, but I'll bet your users don't.

    use: If IsNull(MyValue) Then MyValue = ""

    Cheers,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    You could also place an empty string before the value retrieved from the database.

    Code:
    Label.Caption = "" & rs!SomeField
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width