Hi,
I face a challenge now, how to access SQLite database (*.db file), which is stored on web hosting server (actually it is just a webpage, no real server).
My situation is as follows:
On my webpage there is stored SQLite database global_database.db (among other files related to webpage). In every device, that has installed my application, there is similar SQLite database, stored locally - local_database.db. During run of application, I want to download data from global_database.db and store them to local_database.db, or vice versa.
When I read/write data only from/to local database, everything works fine using following command:
When I want to select data from global_database.db stored on webhosting server, I connect to server using FTP at first (this works OK, because I am copying some files from server through application). Then I try to initialize global database object, and then I wreck. I use following code, but apparently it is wrong.
I got error message: android.database.sqlite.SQLiteException: unable to open database file.
Could you please suggest me how to get data from global_database.db?
Thank you.
I face a challenge now, how to access SQLite database (*.db file), which is stored on web hosting server (actually it is just a webpage, no real server).
My situation is as follows:
On my webpage there is stored SQLite database global_database.db (among other files related to webpage). In every device, that has installed my application, there is similar SQLite database, stored locally - local_database.db. During run of application, I want to download data from global_database.db and store them to local_database.db, or vice versa.
When I read/write data only from/to local database, everything works fine using following command:
B4X:
Dim LocalDB As SQL
Dim csr As Cursor
LocalDB.Initialize(File.DirRootExternal, "FileFolder/local_database.db", False)
csr = LocalDB.ExecQuery("SELECT FirstColumn FROM DataTable ORDER BY FirstColumn ASC")
When I want to select data from global_database.db stored on webhosting server, I connect to server using FTP at first (this works OK, because I am copying some files from server through application). Then I try to initialize global database object, and then I wreck. I use following code, but apparently it is wrong.
B4X:
Dim ServerDB As SQL
ServerDB.Initialize("ftp.webpage.com", "/public_html/DB/global_database.db", False)
I got error message: android.database.sqlite.SQLiteException: unable to open database file.
Could you please suggest me how to get data from global_database.db?
Thank you.