Results 1 to 3 of 3

Thread: I need Help

  1. #1
    Join Date
    Jul 2002
    Location
    Veracruz, Mexico
    Posts
    6

    Unanswered: I need Help

    I'm Making a program that uses SQL server, i don't have problem to connect, but sometimes i receive a error menssage doing this..

    rs.open "SELECT * FROM table"
    while XXXXXXXXX

    text1.text=rs!field1
    text2.text=rs!field2

    end XXXXXXX

    When the field 2 or 1 is NULL or don't have value in the SQL DataBAse VB tell me that i'm doing a ilegal use of NULL value... What i can do-....please helpe

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    You can use a function called isnull() - e.g.

    If IsNull(rs(0)) Then
    Text1.Text = "" --- or put in some other text like N/A ...
    Else
    Text1.Text = rs(0)
    End If

  3. #3
    Join Date
    Jul 2002
    Location
    Veracruz, Mexico
    Posts
    6

    Tanhks

    Soo much thanks
    This code solve the problem, know is working fine all...

    Thanks..

Posting Permissions

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