Hello there,
I’ve been working with an existing sqlite database that I’m supposed to import, read and modify in my corona app.
The code I use is this:
[applescript]
require “sqlite3”
path = system.pathForFile(“prototype1.sqlite”,system.DocumentsDirectory)
db= sqlite3.open( path )
[/applescript]
I output the path in my terminal just to be sure about the location of it (in the sandbox), but my 50kb dbase for some reason gets copied in the sandbox as 0kb, so when I try to run a query to see the data I get a “no such table: tblClients”.
I tried to do the trick that someone suggested in these forums (check if file is in documentsdirectory, if not read it from resouredirectory and then write it to documentsdirectory), but in that case I’m getting a “cannot create path for resource file. File does not exist”.
Is there anything obvious that I’m missing here? Thanks! [import]uid: 47871 topic_id: 9018 reply_id: 309018[/import]