简体   繁体   English

Flash Builder 4.6和sqlite位置

[英]flash builder 4.6 and sqlite location

I am developing an app for iPad 3rd using Flash builder 4.6 with an embedded sqlite database. 我正在使用带嵌入式sqlite数据库的Flash Builder 4.6开发适用于iPad 3rd的应用程序。 Before compiling procedure I copied database in assets folder: on emulator it goes fine but on iPad procedure is unable to retrieve data without errors. 在编译过程之前,我已将数据库复制到Assets文件夹中:在模拟器上运行正常,但在iPad上过程无法无误地检索数据。 This is the instruction to open database: 这是打开数据库的指令:

stmt.sqlConnection.open(File.applicationStorageDirectory.resolvePath("/Users/me/Downloads/test.sqlite")); stmt.sqlConnection.open(File.applicationStorageDirectory.resolvePath(“ / Users / me / Downloads / test.sqlite”));

Tried also to change to 尝试也更改为

stmt.sqlConnection.open(File.applicationStorageDirectory.resolvePath("assets/test.sqlite")); stmt.sqlConnection.open(File.applicationStorageDirectory.resolvePath(“ assets / test.sqlite”));

and, after testing it, changed again to 经过测试之后,再次更改为

stmt.sqlConnection.open(File.applicationStorageDirectory.resolvePath("test.sqlite")); stmt.sqlConnection.open(File.applicationStorageDirectory.resolvePath(“ test.sqlite”));

but no luck: what am I doing wrong? 但没有运气:我做错了什么?

Thank you in advance for help. 预先感谢您的帮助。

I answer myself: place in front of all 我回答自己:摆在所有人面前

var dbFile:File = File.applicationDirectory.resolvePath("db/test.sqlite");
var dbWorkFile:File = File.documentsDirectory.resolvePath("test.sqlite");

if(!dbWorkFile.exists){
    dbFile.copyTo(dbWorkFile);
}

connection has to be modified in 连接必须在

stmt.sqlConnection.open(File.documentsDirectory.resolvePath("test.sqlite"));

Tip found on http://cookbooks.adobe.com/post_Including_a_database_in_an_Adobe_AIR_application-17721.html 可在http://cookbooks.adobe.com/post_Inclusion_a_database_in_an_Adobe_AIR_application-17721.html上找到提示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM