Help in the code below I have a problem in line Cursor3.position = mapid
Using a map to derive the 'ID of a field in a table but does not seem to be MapID declared int int fact, if instead of a fixed number MapID put it all works but if I use the variable does not work. Yet in label1 see it as a number.
???
Using a map to derive the 'ID of a field in a table but does not seem to be MapID declared int int fact, if instead of a fixed number MapID put it all works but if I use the variable does not work. Yet in label1 see it as a number.
???
B4X:
Sub SongACaso(EntryIndex2 AsInt) ' il db normaleDim Cursor3 AsCursorDim Titolo AsStringDim MapTitolo AsStringDim i,MapID AsInt'If IDList.Size = 0 Then 'check if the database is empty
' Return 'if yes leave the routine
'End If
Titolo = spnRepertorio.SelectedItem
Cursor3 = SQL1.ExecQuery("SELECT * FROM [" & TblSpin & "] WHERE [" & GestioneTbl.ColNames(2) & "] = Titolo")
For i=0To Mappa.Size-1
MapTitolo=Mappa.GetValueAt(i)
MapID=Mappa.GetKeyAt(i)
If MapTitolo=Titolo Then
Cursor3.position=MapIDExitEndIfNext
Cursor3.position=MapID
Label1.Text=MapID & "" & MapTitolo& " = " & Titolo
TxtId.Text = Cursor3.GetString(GestioneTbl.ColNames(0))
TxtProg.Text = Cursor3.GetString(GestioneTbl.ColNames(1)) 'read the FirstName columnTxtTitolo.Text = Cursor3.GetString(GestioneTbl.ColNames(2)) 'read the LasstName column
Cursor3.Close 'close the cursor, we don't it anymoreEnd Sub