B4J Question How to know when a resultset is empty?

wimpie3

Well-Known Member
Licensed User
Longtime User
Is this a valid command to know if an SQL resultset is empty?

B4X:
If Not(ResultSet1.NextRow) then ...

As far as I know, nextrow moves to the next record, so my guess is that this if statement doesn't work as intended and that I might need to use an sql rowcount statement first.
 

DonManfred

Expert
Licensed User
Longtime User
- If you haven´t used it before it moves to the first row.
B4X:
If ResultSet1.NextRow then ' work with the data
should work.
- Resultset1 may be not initialized if it contains no data
 
Upvote 1

wimpie3

Well-Known Member
Licensed User
Longtime User
I don't get it. Checking if Resultset1 contains no data is exactly what I'm trying to do... But using isInitialised doesn't work either.
 
Upvote 0
Top