I had an error "invalid use of null". How to get away with this error?
Printable View
I had an error "invalid use of null". How to get away with this error?
If it's on the VB side...
strValue = rs(0).Value & ""
or
text1.Text = rs(0).Value & ""
Concatenating an emptry string in VB will turn NULL into EMPTY strings. VB strings do not like null...
It can be done other ways - but that is the way we prefer in our shop.
This the code line. It means that if the postal code fields has no data on ACCESS it will prompt an error invalid use of NULL. I want that if the ACCESS has an empty fields then TEXT label is also empty.
txtPost.Text = rs.Fields("postal code")
Then do this:
The & "" will turn the database NULL value into an EMPTY string - which is what you say you want.Code:txtPost.Text = rs.Fields("postal code") & ""
Thanks szlamany.
Phew...it's still along way to go.