Open SQLite DB from source folder

Hi Corona Geeks,

my question on the subject  :slight_smile:

When i try to open like below i am getting error

db = sqlite3.open( “db/data.db” )   

I want create a definition database in my source folder. (I wont modify this db, only i will read)  is it possible or not?

Thanks…

This should be possible but suggest you use the following approach recommended in the API docs : 

--Open data.db. If the file doesn't exist it will be created local path = system.pathForFile("db/data.db", system.ResourceDirectory) db = sqlite3.open( path ) 

Hope this works for you.

It is working. Thank you very much ksan  :slight_smile:

Super. Glad this worked for you. 

This should be possible but suggest you use the following approach recommended in the API docs : 

--Open data.db. If the file doesn't exist it will be created local path = system.pathForFile("db/data.db", system.ResourceDirectory) db = sqlite3.open( path ) 

Hope this works for you.

It is working. Thank you very much ksan  :slight_smile:

Super. Glad this worked for you.