Results 1 to 7 of 7

Thread: QSQlite driver

  1. #1
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question QSQlite driver

    Hi,

    how do I connect QSQlite database from Linux (Fedora 9)

    tried to connect to the database with the following code

    //connecting to the database
    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName(":memory:");
    if (!db.open()) {
    QMessageBox::critical(0, qApp->tr("Cannot open database"),
    qApp->tr("Click Cancel to exit."), QMessageBox::Cancel);

    And it returns with the following error
    Error :
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:


    I tried to build QT with
    configure -qt-sql-qsqlite ( also tried with -plugiin-sql-qsqlite
    gmake
    gmake install

    can somebody guide, to resolve this problem ?


    thanks in advance

  2. #2
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSQlite driver

    as you can read typing ./configure --help, try
    Qt Code:
    1. ./configure -qt-sql-sqlite -plugin-sql-sqlite
    To copy to clipboard, switch view to plain text mode 

    also don't forget to add the following to your *.pro file:

    Qt Code:
    1. QT += sql
    To copy to clipboard, switch view to plain text mode 
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

  3. #3
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSQlite driver

    Thanks calhal,

    but even this did not work. Is there any other way ?

  4. #4
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSQlite driver

    Do you have any files in <your_Qt_prefix>/plugins/sqldrivers?

    If not, how do you exactly compile Qt (show the ./configure command you've used)? During configure (before you type make), can you see something like this:
    Qt Code:
    1. SQLite support ..... plugin(qt)
    To copy to clipboard, switch view to plain text mode 
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

  5. #5
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSQlite driver

    Hi

    first of all I have tried it in two different systems

    1. Open suse
    2. Fedora 9

    the one in Open suse is working perfectly fine, but nothing is happening in Fedora 9.

    could you tell me how can i uninstall QT in fedora 9 ? so that I could try reinstalling again.

    thanks

  6. #6
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSQlite driver

    Hi,

    Yes during configuration there is an entry saying

    SQLite support ..... plugin(qt)

    but still couldn't connect to the database ...

    thanks
    Last edited by praveen_g; 17th November 2009 at 11:41.

  7. #7
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSQlite driver

    how do I check the dependencies for sqlite to build with QT 4.3 ?

    could not succeed in configuring Sqlite with QT in Fedora Core 9, can somebody help me out in this front ?

    Its pretty urgent

    thanks

Similar Threads

  1. QSQLITE driver is driving me nuts!
    By topquarck in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2009, 09:29
  2. QSQLITE driver issue
    By b1 in forum Qt Programming
    Replies: 6
    Last Post: 17th May 2009, 09:18
  3. Cannot load SQLITE driver on clean target
    By ForestDweller in forum Installation and Deployment
    Replies: 1
    Last Post: 15th December 2008, 00:49
  4. Replies: 1
    Last Post: 7th July 2008, 20:13
  5. regarding a touch screen driver for qt-embedded
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd March 2007, 10:23

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.