jeudi 17 décembre 2015

Load pre-populated database sqlite+cordova+visual studios

I have a pre-populated database made with Sqlite Manager in firefox. I created the database, and tables, and saved it to my 'www' folder in my project. Then inside visual studios I have done the following:

var db = window.sqlitePlugin.openDatabase({ name: "corebuilder.sqlite", createFromLocation: 1 });

db.transaction(function(tx) {
    tx.executeSql("UPDATE updates SET timestamp=? WHERE id=?, ["1", 1], successHandler, errorHandler);
});
function successHandler(tr, results) {
}
function errorHandler(tr, error) {
    console.log(error.message);
}

When I run this code, I get the following error:

sqlite3_prepare_v2 failure: no such table: updates

I am using Visual Studios with Cordova sqlite storage plugin from http://ift.tt/1s13J1g

Aucun commentaire:

Enregistrer un commentaire