mr.gedo
Member
Hello all,
i have problem after update my databse and my app
i had (Table1) and work fine, i added another table (Table2) and update my app but when i try to view Table2 data giv me error (No such table)
i must unistall the app first and then reinstall it to works without problems
this code before add Table2
and after update my databse and try to view data i get the error
i have problem after update my databse and my app
i had (Table1) and work fine, i added another table (Table2) and update my app but when i try to view Table2 data giv me error (No such table)
i must unistall the app first and then reinstall it to works without problems
this code before add Table2
B4X:
Sub Process_Globals
Dim SQL As SQL
Dim CUR As Cursor
Dim DBFileDir As String : DBFileDir = File.DirRootExternal ': DBFileDir = File.DirDefaultExternal
Dim DBFileName As String : DBFileName = "data.db"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
If FirstTime = True Then
DBFileDir = DBUtils.CopyDBFromAssets("data.db")
SQL.Initialize(DBFileDir, DBFileName, True)
End If
End Sub
and after update my databse and try to view data i get the error
B4X:
Sub Button2_Click
CUR = SQL.ExecQuery("SELECT * FROM Table2")
For i = 0 To CUR.RowCount - 1
CUR.Position = i
CLV.Add(CreateListItem(CUR.GetString("Name"),CUR.GetString("Age"), CLV.AsView.Width, 260dip), $"Item #${i}"$)
Next
End Sub