无法写入打包空气中的 sqlite db
我在IDE(FB)中运行时可以写入数据库,但打包完空气后,应用程序不会写入sqlite db,为什么?提前致谢。
I can write to db when running in IDE(FB), while after packaging a air, the app wont write to sqlite db, Why? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能的原因是您安装的 Air 应用程序无法解析 sqlite 文件的路径。
我通常做的是使用 File 类的静态公共属性之一来解析我的 sqlite 文件,例如。
这里的关键位是 File.applicationDirectory.resolvePath('mydb.sqlite') 行,在本例中,AIR 将在应用程序安装的目录中查找名为 mydb.sqlite 的文件 -在您的开发环境中,这将与 bin-debug 文件夹(或您要编译到的任何文件夹)相同。
希望有帮助,如果没有的话,如果您可以发布您正在使用的代码,以及您遇到的错误,我会尽力进一步帮助您。
The likely cause is that your installed Air application can't resolve the path to your sqlite file.
What I normally do is to use one of the static public properties of the File class to resolve my sqlite file from eg.
The key bit here is the File.applicationDirectory.resolvePath('mydb.sqlite') line, in this instance AIR will look for a file called mydb.sqlite in the directory that the application is installed into - in your development environment this would be the same as the bin-debug folder (or whatever folder you are compiling to).
Hope that helps, if not if you can post the code you are using , and what error you are getting I will try and help you further.
最可能的原因是您的数据库文件驻留在应用程序目录中,该目录是只读的。
来自 Flex 3.5 语言参考:
如果是这种情况,一个可能但不仅仅是简单的解决方案是仅使用 File.applicationStorageDirectory。
希望这有帮助。
N。
The most likely reason is that your DB file resides in the application directory, which is read only.
From Flex 3.5 Language Reference:
If this is the case, a possible but not only easy fix would be to just use File.applicationStorageDirectory.
Hope this helps.
N.