Sqlite
-
I've been using the basic demo for using a database see blow. I now need more usage out of my sqlite so I made my own with a sqlite builder but I can't see to use it.
// What I've been using to learn
@var db = LocalStorage.openDatabaseSync("DB3", "1.0", "The Example QML SQL!", 1000000);
db.transaction(
function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
for ( var z=0; z<1000; z++){
tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'Movie', z ]);
}
var rs = tx.executeSql('SELECT * FROM Greeting');
r=""
for(var i = 0; i < a; i++) {
if (i>index_count-1 && up_check ===0)
r += rs.rows.item(i).salutation + ": " + rs.rows.item(i).salutee + "\t\t"
......
......
@
Now I've created my own sqlite db that I want to use "mydatabase.sql" but I can't seem to get it to work when I@
var db = LocalStorage.openDatabaseSync("mydatabase", "1.0", "The Example QML SQL!", 10000);
.....
......
.....
var rs = tx.executeSql('SELECT * FROM film_db');
.....
@I get this error
"no such table: film_db Unable to execute statement"
but film_db is the name of my table when I created the mydatabase.sqlPlease help I'm pulling my hair out on this one.
-
Hi,
I am not an expert at all with QML but shouldn't you open mydatabase.sql since it's the name of your database ?
-
Also, are your sure your database contains the missing table ?