PercyKumah
New Member
I'm new to B4A and android. In fact I'm building my first test app. I followed this tutorial: and attempted to create my first app. Below is mu code:
When I debug I get the following error:
"android.database.sqlite.SQLiteException: no such table: products (code 1 SQLITE_ERROR): , while compiling: SELECT * FROM products"
I have followed various posts in this forum and on google search that suggested removing the app from the emulator and reinstalling, deleting the db and recreating among others but nothing works.
Am I doing this thing wrong, are there other parameters I need to specify?
Thanks in advance
In my starter file after declaring sql AS SQL:
If File.Exists(File.DirInternal,"sql.db") = False Then
File.Copy(File.DirAssets,"easyverify.db", File.DirInternal, "sql.db")
End If
'make a connection to the copied internal dir file
sql.Initialize(File.DirInternal, "sql.db", True)
End Sub
In my 'main' file:
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private btnHello As Button
Private txtSearch As EditText
Dim cur As Cursor
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
cur = Starter.sql.ExecQuery("select id, fname from table1")
cur.Position = 0
txtSearch.Text = cur.GetString("fname")
cur.Close
End Sub
When I debug I get the following error:
"android.database.sqlite.SQLiteException: no such table: products (code 1 SQLITE_ERROR): , while compiling: SELECT * FROM products"
I have followed various posts in this forum and on google search that suggested removing the app from the emulator and reinstalling, deleting the db and recreating among others but nothing works.
Am I doing this thing wrong, are there other parameters I need to specify?
Thanks in advance