If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > I need Help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-28-02, 00:44
Rasatan Rasatan is offline
Registered User
 
Join Date: Jul 2002
Location: Veracruz, Mexico
Posts: 6
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
Reply With Quote
  #2 (permalink)  
Old 07-28-02, 08:28
rnealejr rnealejr is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 07-28-02, 22:12
Rasatan Rasatan is offline
Registered User
 
Join Date: Jul 2002
Location: Veracruz, Mexico
Posts: 6
Tanhks

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

Thanks..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On