Android Question [SOLVED] How to check if resultset string is empty

agricult

Member
Licensed User
Hello, I have very little VB programming experience from 30 years ago but still managed to make good use of the great B4X. My problems start when I want to do things "nicer" or shorter.
I tried to check if a database string field in a resultset is empty and found the If NOT (rs.GetString("Litter")= NULL) THEN option in the forum but that doesn't work for me (using IF rs.GetString("Litter")="" doesn't work either), I can work around it by always using e.g."-" for an empty field in the DB but being able to check would be easier.
If NOT (... = NULL):
    If Not (rs.GetString("Litter")=Null) Then
            lbllitter.Text=xx.GetString("Littersize")
    End If
If somebody is willing to give me a hint why it doesn't work that way, thank you very much in advance.
 

agricult

Member
Licensed User
What do you mean with empty? Is the value 'null' in the database?
I created the DB structure with "DB Browser for SQLite", where I also added my testdata. On start the empty fields show NULL but once I added and deleted data in a field it shows "nothing" not even NULL
 
Upvote 0
Top