Hi, I have to develop an AIR application that run in Win and Mac. The app is used by all the system users, I have to store a set of data in a db and I need that the data entered by a user are availabble to all users. If I create th db in the user data store folder this is not possible so how can I do that? I try to create the db in the app path and this work only if I manually set manually the folder privileges or if I develop a setup program thet set the folder access policy. There are a way t create data and save file in a folder availabble to all users?
Hello,
When openning a database with SQLConnection, you can specify the location of the database as the first parameter of the open function. So if the location of the database can be accessed by all system users, these users can share the data in the database. Please try with the following code:
var dbFile:File = new File("c:\\test.db");
var conn:SQLConnection = new SQLConnection();
conn.open(dbFile,SQLMode.CREATE);
Any problem, please feel free to let us know. ![]()
Thanks,
Yang
The problem is that I need to create a folder where put the db and this folder need write privileges for all users. Can I do that from AIR?
I try to create the db in the app folder ex: app:mydata.db but when I try the app in win7 I need to manually set write privileges to the app folder... my app have to run on mac and linux also. I need a way to manage access privileges in all os and inform the user that he need the admin privileges to do some operations...
Could you try with the following code?
var dbFolder:File = File.applicationStorageDirectory.resolvePath("db");
dbFolder.createDirectory();
var dbFile:File = dbFolder.resolvePath("test.db");
var conn:SQLConnection = new SQLConnection();
conn.open(dbFile,SQLMode.CREATE);
Hope this could help!
The problem is that the applicationStorageDirectory isn't relative to the application but is relative to the user, isn't true?
So if many users use the application every user have a own database and this is exactly what I don't want I need a db in a folder where all the users can access and write it but I haven't a way to create this folder by air. So I need an application storage folder relative to the application not to the user.
I think that I will develop an installation program that create a new folder with write priviledges for all the system users. The problem is that I have to develop a native installer for every system. It could be very usefull in future release of AIR if we can add custom operation in the installation program like setting folder priviledges.
North America
Europe, Middle East and Africa
Asia Pacific