I try to deal with SQLite database on Qt 4.5.3 on Linux. I've already created DB with another program and it looks like this: screenshot
Then, I try to perform select on Qt:
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(filename); // Here is FULL path to the database. I've checked it twice :)
bool ok = db.open();
qDebug() << db.tables();
QSqlQuery query;
query.exec("select * from lessons");
qDebug() << query.size();
qDebug() << query.isSelect();
qDebug() << query.isValid();
But debug console says:
("lessons", "weeklessons", "weeks")
-1
true
false
Why it's select nothing? What I have doing wrong?