When running this code I get: "cursor not initialized" ERROR.
I just noticed another error which is probably primary to the Cursor error.
"Unable to open database file".
so what is wrong with my database ?
any ideas ?
Art
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout_v1.bal")
' If File.Exists(File.DirInternal,"jcont.db") = False Then
' File.Copy(File.DirAssets,"jcont.db",File.DirInternal,"jcont.db")
' End If
If FirstTime Then
SQL1.Initialize(File.DirDefaultExternal, "jcont.db", False)
End If
'---------------------------------------------------------------------
ListView1.Initialize("ListView1")
If Cursor1.IsInitialized = 1 Then
Cursor1 = SQL1.ExecQuery("SELECT * FROM jos_users ORDER BY name")
If Cursor1.RowCount > 0 Then
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
ListView1.AddSingleLine(Cursor1.getString("name") & ":" & Cursor1.GetString("username")& (CRLF) & " Email:" & Cursor1.GetString("email")& (CRLF))
Next
Activity.AddView(ListView1, 0, 0, 100%x, 100%y)
End If
End If
End Sub
I just noticed another error which is probably primary to the Cursor error.
"Unable to open database file".
so what is wrong with my database ?
any ideas ?
Art
Last edited: