flex4.5移动开发操作sqlite数据库

由于sdcard存储是只读模式,flex4.5移动开发操作sqlite数据库时,只能查询,不能insert,update,delete,所以初始化应用的时候要把sqlite的数据库copy的程序安装的目录下,代码如下:

  var dbFiledb:File = new File("/mnt/sdcard/erppos/erppos.db");  

    var dbWorkFile:File = File.applicationStorageDirectory.resolvePath("database/erppos.db");
    if(!dbWorkFile.exists){ 
     dbFiledb.copyTo(dbWorkFile);
    }

 

 

建立连接的时候:

file = File.applicationStorageDirectory.resolvePath("database/erppos.db");            sqlConnection = new sqlConnection();                                   sqlConnection.addEventListener(sqlEvent.OPEN,openHandler);      sqlConnection.addEventListener(sqlErrorEvent.ERROR,errorHandler);               stmt = new sqlStatement();            stmt.sqlConnection = sqlConnection;            sqlConnection.open(file);

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...