Android Question SQLite Error when tried to initialize

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I am trying to open Sqlite data as read only, the codes is like this
B4X:
    If FirstTime Then 
   SqlLt.Initialize(File.DirAssets, "data.db", True)
End If

I got error SQLiteCantOpenDatabaseException : unknown error (code 14): Could not open database

But, if I change to this
B4X:
    If FirstTime Then 
        If File.Exists(File.DirRootExternal, "data.db") = False Then
            File.Copy(File.DirAssets, "data.db", File.DirRootExternal, "data.db")
        End If
        SqlLt.Initialize(File.DirRootExternal, "data.db", True)
    End If

It is Ok.

I don't need to do insert or update operation, just read data, why is that data need to copy from DirAssets to DirRootExternal?

Thanks in advance.
 
Top