I got a error message "could not prepare statement (1 no such table:
LivroDaBiblia) (Code 5)"
trying the following code on executeSQL SELECT......
The message was captured at console.log of CHROME
When I use command line shell it works fine. The table is OK with 66 lines.
Anyone can help me??
var DEMODB;
var tx;
$('#LV1').append("<li>7887</li>");
$(document).ready(function () {
try {initDatabase();
$('#LV1').append("<li>222222</li>");
DEMODB.transaction(
function (transaction) {
transaction.executeSql("SELECT nome FROM LivroDaBiblia;",
[],
dataSelectHandler, errorHandler);
}
);
$('#LV1').append("<li>999999999</li>");
} catch (e) {
}
function dataSelectHandler(transaction, results){
$('#LV1').append('<li>yyyyyyyyy </li>');
for (i = 0; i < result.rows.length; i++) {
var nome = result.rows.item(i)['nome'];
//$('#LV1').append('<li>' + nome + '</li>');
console.log('variavel ' + i);
$('#LV1').append('<li>xxxxxxxxxx </li>');
};
}
function errorHandler(transaction, error) {
console.log('Oops. Error was ' + error.message + '
(Code ' + error.code + ')');
return false;
};
function initDatabase() {
try {
if (!window.openDatabase) {
console.log('Databases are not supported in this
browser.');
} else {
var shortName = 'BibliaVVV.sqlite';
var version = '';
var displayName = 'DEMO Database';
var maxSize = 100000; // bytes
DEMODB = openDatabase(shortName, version, displayName,
maxSize);
//createTables();
//selectAll();
}
} catch(e) {
if (e == 2) {
// Version number mismatch.
console.log("Invalid database version.");
} else {
console.log("Unknown error wer "+e+".");
}
return;
}
}
DEMODB.close();
});
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users