SQLite version conflict

adamioan

Member
Licensed User
Longtime User
Hi there, I have a small problem.
I have a web site on a paid server and I use PHP and SQLite to populate data. The SQLite version of the server is 2.8.17.
I 'm building an android application that uses the server data, and stores them into a local SQLite file. Initially I tried to just download the server's database file and use it directly, but my android phone cannot handle SQLite v2 databases, only v3 (3.5.1).
I tried to download the database SQL script from web server for creating all the tables and inserting the data, and executed this from my app, and that did the job. But this is taking too long to complete (about 1 1/2 minute) and the update process is taking place at the program initialization.
I there something that I can do to create the initially SQLite db on the server in version 3? (I don't have the right to install SQLite3 on server)
Or is there a way to make android manipulate SQLite v2 databases?
(Or is there something else that will make all the process more efficient and smooth?)

Thank you in advance
 

adamioan

Member
Licensed User
Longtime User
OK, I just manage to do it work.
Both SQLite versions are installed in server. I had to declare the database opening by another way in order to activate SQLite3 functions.
Here is the statement, if someone need it:
B4X:
// Connect to SQLite3 database (Create it if missing)
$sqlite_con = new PDO('sqlite:database_name.db');
// Executing commands
if (!$sqlite_con->exec($SQLiteCreation)) echo "Inserting error on SQLite3";
 
Upvote 0
Top