How do you open a remote sqlite database over http

2019-08-02 06:11发布

Is it possible to open an sqlite file over http? I only need to read the db, and was hoping I could do something like:

var dbFile:File = new File("http://10.1.1.50/project/db.sqlite");
sqlConnection.open(dbFile);

Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'

My situation calls for several apps compiled for various devices to share this file, which is served locally via wamp.

4条回答
Lonely孤独者°
2楼-- · 2019-08-02 06:30

You can adapt your code to use modsqlite http://modsqlite.sourceforge.net/#using

查看更多
Juvenile、少年°
3楼-- · 2019-08-02 06:30

there's an apache module to allow remote sqlite access via http.

http://modsqlite.sourceforge.net/

查看更多
一夜七次
4楼-- · 2019-08-02 06:36

Zip your sqlite file from db.sqlite to db.zip. Load this zip file in flex using URLLoader and unzip it back in flex.

If not, you can also rename the file's extension to .xml, load it using httpservice or urlloader and once you get the result, you can rename the file's name back to .sqlite and start querying the file and it will work just fine.

查看更多
Explosion°爆炸
5楼-- · 2019-08-02 06:48

There is no way you can achieve this over HTTP. SqLite is a file and not a service/process that may be accessible via any port.

The best case scenario is when you have network access to the computer where the sqlite file is stored, like:

\\myserver\databases\mysqlitefile.db

...but this may work only on windows :(

查看更多
登录 后发表回答