I solved this with a List containing the IDs, but in my case I don't use DBUtils but directly SQL functions.
You could use a routine like this:
Dim RowIDs As List
.
RowIDs.Initialize
.
Sub GetIDs
Dim Curs As Cursor
Dim i As Int
RowIDs.Clear
Curs = SQL1.ExecQuery("SELECT ID FROM Restaurants")
For i = 0 To Curs.RowCount - 1
Curs.Position = i
RowIDs.Add(Curs.GetInt("ID"))
Next
End Sub
Replace
ID by the ID column name and
Restaurants by your table name.
Dim RowIDs in Process_Globals.
Initialize RowIDs In Activity_Create.
In the list you have the IDs for each row beginning with index 0.
Best regards.