Results 1 to 2 of 2

Thread: qsqlite QSqlError(-1, "Driver not loaded", "Driver not loaded")

  1. #1
    Join Date
    Apr 2010
    Posts
    10
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default qsqlite QSqlError(-1, "Driver not loaded", "Driver not loaded")

    Hello Everyone,

    I have looked at a few threads on the forums about this topic but could not find one that deals with windows 7 or a windows platform in general.

    I have a bit of code here...
    Qt Code:
    1. currentDB = new QSqlDatabase;
    2. currentDB->addDatabase("QSQLITE");
    3. currentDB->setHostName("broker");
    4. currentDB->setDatabaseName(temp);
    5. currentDB->setUserName("MTG");
    6. currentDB->setPassword("MTG");
    7. if(currentDB->open())
    8. {
    9. qDebug() << "DB opened successfully";
    10. }
    11. else
    12. {
    13. qDebug() << "DB not opened successfully" << currentDB->lastError();
    14. }
    To copy to clipboard, switch view to plain text mode 

    Whenever my program gets to this section it complains because...
    QSqlError(-1, "Driver not loaded", "Driver not loaded")

    I have seen lots of stuff on the internet about this problem, but i am having a really hard time finding a fix for windows. I am trying to use sqlite here.

    I am also having the same problem on my linux machine, but i am trying out some of the other threads' suggestions for solving that.

    Can someone please help me asap with this problem for windows 7.

    Thanks in advance!

  2. #2
    Join Date
    Apr 2010
    Posts
    10
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qsqlite QSqlError(-1, "Driver not loaded", "Driver not loaded")

    I actually solved the issue.

    Instead i did this...
    Qt Code:
    1. QSqlDatabase currentDB = QSqlDatabase::addDatabase("QSQLITE");
    2.  
    3. currentDB.setHostName("MTG");
    4. currentDB.setDatabaseName(temp);
    5. currentDB.setUserName("MTG");
    6. currentDB.setPassword("MTG");
    7. if(currentDB.open())
    8. {
    9. qDebug() << "DB opened successfully";
    10. }
    11. else
    12. {
    13. qDebug() << "DB not opened successfully" << currentDB.lastError();
    14. }
    To copy to clipboard, switch view to plain text mode 

    Worked great.

Similar Threads

  1. Replies: 4
    Last Post: 10th November 2009, 20:48
  2. Replies: 3
    Last Post: 25th August 2009, 14:03
  3. The strange problem:"QSqlDatabase: QMYSQL driver not loaded"
    By osmanthus in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd January 2009, 16:12
  4. The PostgreSQL plugin is not loaded in "SQL Browser" example
    By Scratch in forum Installation and Deployment
    Replies: 1
    Last Post: 18th November 2008, 02:30
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Tags for this Thread

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.