Results 1 to 3 of 3

Thread: sqlbrowser and sqlite

  1. #1
    Join Date
    Mar 2008
    Posts
    141
    Thanks
    10
    Thanked 9 Times in 9 Posts

    Default sqlbrowser and sqlite

    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?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: sqlbrowser and sqlite

    SQLite support is compiled by default. First try what:
    Qt Code:
    1. qDebug() << QSqlDatabase::drivers();
    To copy to clipboard, switch view to plain text mode 
    outputs? Could you also show use how you call QSqlDatabase::setDatabaseName()?
    J-P Nurmi

  3. #3
    Join Date
    Mar 2008
    Posts
    141
    Thanks
    10
    Thanked 9 Times in 9 Posts

    Red face Re: sqlbrowser and sqlite

    hi jpn .-) thanx in advance for always helping me (or trying to .-)

    qDebug gives me: ("QSQLITE")

    the code is :

    Qt Code:
    1. db = QSqlDatabase::addDatabase("QSQLITE");
    2. db.setDatabaseName("db");
    To copy to clipboard, switch view to plain text mode 

    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:

    Qt Code:
    1. QMetaObject::invokeMethod(&w, "addConnection", Qt::QueuedConnection);
    To copy to clipboard, switch view to plain text mode 

    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 ...
    Last edited by janus; 31st March 2008 at 16:26.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.