Android Question android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open dat

CyclopDroid

Well-Known Member
Licensed User
Longtime User
I've create a db with SQLlite and insert into my Dirassets,but when i load it, this errore appear.
Where is the problem?
B4X:
LstDati.Clear
    Dim Cursor1 As Cursor                               
    Dim txt As String
    SQL_Lettura.Initialize(File.DirAssets,"FrsPa.db",False)
    txt = "SELECT * FROM Parolando WHERE lenParola = " & Prima & " or lenParola = " & Seconda & " order by lenParola"
    Cursor1 = SQL_Lettura.ExecQuery(txt)

.....
......
......
.....
Thanks
 

DonManfred

Expert
Licensed User
Longtime User
You first need to copy the db to a place where it is writeable... DirAssets are write-protected.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
But my Db it's no writable... it's only for read
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Ok. I provvide to change the destination into DirInternal and test if work.
Thanks you. see ya.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Yes are sure. The DB it's mounted and full. With SQLlite I see all data and the SQL command result true value.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Ok the problem is really the DirAssets point.... I controll if file exist into Dirinternal and, if not exist, I copy my db from DirAssets to DirInternal and, when I finish, delete it. ;)
 
Upvote 0
Top