To aid a member ,I have nocked up a small app in an effort to demonstrate methods of getting images from the camera and gallery, and saving them to a database for future viewing. Basic but it serves its pupose.
This app worked great on one devise but is throwing a Cursor error on another.
debugging in exactly same way on both devices sheds no light
the app has been uninstalled. The db has been deleted and replace with a new db.
logs show there is datarows. I have viewed the db with external viewer. I am at a loss what to try now.
I have uploded the project if anyone is interested (It was being uploaded eventually anyway), you only have to take/get 1 image and save to db.. then 'View DB' to get the error (or not).
Regards mj
This app worked great on one devise but is throwing a Cursor error on another.
debugging in exactly same way on both devices sheds no light
the app has been uninstalled. The db has been deleted and replace with a new db.
logs show there is datarows. I have viewed the db with external viewer. I am at a loss what to try now.
this is the section of code .. Cursor1 is dimmed in Process Globals and is Closed after each referenceerror ....
java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
B4X:
Sub btnViewDBImages_Click
'
'
'
'populate the listview with db records .. data and images ...
Cursor1 = SQL1.ExecQuery("SELECT * FROM Persons")
Dim RecID, Fname, Lname As String
Dim numRec As Int = Cursor1.RowCount
Log (numRec) '@@ shows records ..
'if there is records in the db then list them
If numRec > 0 Then
For i = 0 To numRec -1
Cursor1.Position = i
RecID = Cursor1.GetInt("ID") '@@@ This is the ERROR
Fname = Cursor1.GetString("FirstName")
Lname = Cursor1.GetString("LastName")
I have uploded the project if anyone is interested (It was being uploaded eventually anyway), you only have to take/get 1 image and save to db.. then 'View DB' to get the error (or not).
Regards mj
Attachments
Last edited: