I get the error "Can't read row 0 col 3 from CursorWindow. Make sure the cursor is initialized correctly...". The error occurs on the line shown below. I see that this cursor not initialized error is an old thread but I don't see that the problem was ever clearly resolved.
Full Sub below:
B4X:
bytes = cursor1.GetBlob("myPicture")
Full Sub below:
B4X:
Sub displayPersonalInfo
Dim cursor1 As Cursor
Dim bytes() As Byte
NewFileFlag = False
Try
cursor1 = SQL1.ExecQuery("SELECT screename, phonenumber, YOB, myPicture FROM PersonalInfo WHERE ID = 1")
If cursor1.RowCount = 0 Then
Msgbox("","No Personal Information found")
NewFileFlag = True
cursor1.Close
Else
cursor1.Position = 0
bytes = cursor1.GetBlob("myPicture")
If bytes.Length > 0 Then
UI.InitializeFromBytesArray(bytes, 0, bytes.Length)
bmp.Initialize2(UI)
End If
PN = cursor1.GetString("phonenumber")
SN = cursor1.GetString("screename")
YB = cursor1.GetString("YOB")
cursor1.Close
End If
Catch
Msgbox("error in reading from PersonalInfo table","")
Log(LastException.Message)
cursor1.Close
End Try
Activity.LoadLayout("PersonalInfo")
ScreenName.Text = SN
PhoneNumber.Text = PN
YOB.Text = YB
UserImage.Bitmap = bmp
End Sub