Your code looks good except that you need spaces in this SQL statement like this:SELECT * FROM capitals. The problem is the test.db is a bad file that I could not open.
never use sqlite myself so I don't know how it is supposed to behave but what I see is that the copy works fine but the sql1.init trashes the file again even when using FALSE for autocreate.
I am not sure I agree with your explanation, because the following statement in his code should copy the db from assets to defaultexternal. Try to open the db via any db utility, you will find out it does not open
B4X:
If File.Exists(File.DirDefaultExternal,"test.db")=False Then
File.Copy(File.DirAssets,"test.db", File.DirDefaultExternal,"test.db")
End If
How did you generate the database ?
I tested your project and I get the same error.
Then I tryed to open the database with SQLiteoPro2009 and I get the message that the database is encripted !?
So without knowing what exactly you have done it's difficult to give you a concrete advice.
Hoe did you generate the database ?
I tested your project and I get the same error.
Then I tryed to open the database with SQLiteoPro2009 ad I get the message that the database is encripted !?
So without knowing what exactly you have done it's difficult to give you a concrete advice.
I created it from the SQLite Manager Add-on with Mozilla. Selected 'new database' tab and built it from the tabs within that (add column, add row etc). I then selected the 'Export Database' option from the database tab into the 'app' file folder as a .db file.
Thanks for all the replies, I appreciate the time.