but the db file may not exist,i just use sqlite3_open to create it. how can i do for it?
Create your DB in CCFileUtils::getWriteablePath().
tugua wang wrote:
i also hava a question,in the same case,why pic can be read,but the db is not?their path is same! anyone know?
The problem is that everything inside assets folder is read-only so it is necessary to copy DB to location where it can be modified. I have not tried opening DB from assets folder but i think it can be done only in SQLITE_OPEN_READONLY mode.
if i use “Create your DB in CCFileUtils::getWriteablePath()”,but how can i get this path? CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(“xxx.db”);?because when next time opening the app, i should judge if the db file has been created using the path.