Hi, I'm banging my head against something soft...
Below code gives me 'Cursor is not initilized'-error. I had it in an Activity before but now I am running this in a Class. Does it matter if it's in an Activity or Class?????
The cursor doesn't have an Initilize. What am I doing wrong???
Below code gives me 'Cursor is not initilized'-error. I had it in an Activity before but now I am running this in a Class. Does it matter if it's in an Activity or Class?????
B4X:
Sub FillHistory2(lDate As String)
Dim crnames As Cursor
Dim rowitem As String
Dim t As String
lstHistory.Clear
crnames = Main.SQLuser.ExecQuery("SELECT intid, uttid, indatum, projekt FROM time WHERE indatum = '" & lDate & "' ORDER BY intid DESC")
If crnames.RowCount > 0 Then
For i = 0 To crnames.RowCount - 1
crnames.Position = i
If crnames.GetString("indatum")=lDate Then 'DateTime.Date(DateTime.now) Then
If crnames.GetString("uttid") <> "00:00:00" Then
rowitem=sf.left(crnames.GetString("intid"),5) & "-" & sf.Left(crnames.GetString("uttid"),5) & " " & crnames.GetString("projekt")
Else
rowitem=sf.Left(crnames.GetString("intid"),5) & "-" & " Pågår " & crnames.GetString("projekt")
End If
lstHistory.AddSingleLine(rowitem) 'crnames.GetString("Name"))
End If
Next
Else
lstHistory.AddSingleLine("<Inga projekt denna dag>")
End If
crnames.Close
End Sub
The cursor doesn't have an Initilize. What am I doing wrong???