iOS Question [Solved] How to get currentRow number of database?

anOparator

Active Member
Licensed User
Longtime User
Am trying to get the "currentRow" id number each time I press btnNext or btnPrevious, by using For/Next.
' NextRow is a nice member but where is the CurrentRow equivelant?
B4X:
 Sub btnNext_Click    ' the following code is from a larger Sub that btnNext calls.
   Public rs As ResultSet
   rs = SQL1.ExecQuery("SELECT rowID FROM table1")
   Dim i As Int
   For i = 0 To rs - 1
        rs.Position = i   ' use what instead of rs.Position
        myRowIDAdd(rs.GetInt2(0))
   Log("current in database = " & rs.Position)   how to get rs.Position/row?
   Next
End Sub
and when fetching an image from a db
B4X:
Sub prnt2
   Dim rs As ResultSet = SQL1.ExecQuery("SELECT id FROM images WHERE rowID = " & myRowID.Get(pos))
   rs.Position = 0   ' use what instead of rs.Position?
   Log("current row in database = " & rs.Position)   how to get current rs.Position/row?
End Sub
thanks in advance for the pointers.
Edit: just found DBUtils with ExecuteMemoryTable, I might not have to buy a new keyboard after all.
 
Last edited:

anOparator

Active Member
Licensed User
Longtime User
Here in B4I we can make the database ID a variable, and step forward or backwards thru the db. Thanks.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Here in B4I we can make the database ID a variable...
This is valid not only for B4i, but the same can be used in B4A and B4J.
The B4i projects you are refering to do exist for all three products and are part of the B4X SQLite Database Booklet.
 
Upvote 0
Top