PDA

View Full Version : sqlbrowser and sqlite



janus
30th March 2008, 18:56
Hi,
I have build Qt4.3.4 on PcLinuxOs. Everything worked fine. I can compile with Eclipse like I do on Windows. But my app, that i did on Windows (and worked fine with a sqlite db, sqlite plugin) does not read the data from the database. I seems it is connected but does not load the data. I tried sqlbrowser from the demo and i can pick Sqlite there. But it either cant open the database. If i create a new one with sqlite3 tool it also does not open the database.
Maybe i should reconfigure with -plugin option(?): If i reconfigure qt on linux. Do I need to delete everything that was installed or is it just overriden?

jpn
31st March 2008, 14:42
SQLite support is compiled by default. First try what:

qDebug() << QSqlDatabase::drivers();
outputs? Could you also show use how you call QSqlDatabase::setDatabaseName()?

janus
31st March 2008, 14:59
hi jpn .-) thanx in advance for always helping me (or trying to .-)

qDebug gives me: ("QSQLITE")

the code is :


db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("db");

On Windows all works fine. I am using Linux now because I want to use Valgrind (you might remember: the memory leak thread .-) )

seems to be ok ... But I also wonder why I can not open a sqlite database with sqlbrowser when i have crated one with the sqlite3 tool. Could that be a problem with the version?

-----------------------

I works now ... I forgot to add this in the main.cpp:


QMetaObject::invokeMethod(&w, "addConnection", Qt::QueuedConnection);

data are now loaded ... maybe the main.cpp was overwritten when i created the project. sry, my mistake.

-----------------------

But there seems to be a version problem

I get an SQL error: errDbText: no such function: group_concat

so, i guess I have to compile again with the latest sqlite code. And some characters (ä, ü, etc. ) do not work ...