Results 1 to 4 of 4

Thread: Can't use sqlite if Qt development Framework not installed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default Can't use sqlite if Qt development Framework not installed

    I don't understand why this code not executed when Qt development Framework not installed.

    Qt Code:
    1. ....
    2. ....
    3.  
    4. extern QSqlDatabase dbFav;
    5.  
    6. void DB::init() // this is static void
    7. {
    8. QDir dir;
    9. if (!dir.exists(CONF_PATH))
    10. dir.mkpath(CONF_PATH);
    11.  
    12. //favorite
    13. dbFav=QSqlDatabase::addDatabase("QSQLITE", "favorite");
    14. dbFav.setDatabaseName(QString("%1/favorite.%2").arg(CONF_PATH).arg(DB_SUFFIX));
    15. dbFav.open();
    16. QStringList tablesFav = dbFav.tables();
    17. QSqlQuery queryFav(dbFav);
    18. if (!tablesFav.contains("folder", Qt::CaseInsensitive)) {
    19. queryFav.exec("CREATE TABLE folder ("
    20. "id integer primary key,"
    21. "nama text not null,"
    22. "id_induk int not null,"
    23. "unique(nama, id_induk)"
    24. ")");
    25. }
    26. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can't use sqlite if Qt development Framework not installed

    Have you deployed the Qt Sqlite database plugin with your executable? Search this forum... this problem is addressed nearly every day.
    Last edited by ChrisW67; 4th March 2011 at 06:12.

  3. #3
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Can't use sqlite if Qt development Framework not installed

    I know that. But not work ..

    myapp.exe
    plugins/qsqlite4.dll
    ....
    ....

    Btw, I run on Windows 7

    I know that. But not work ..

    myapp.exe
    plugins/qsqlite4.dll
    ....
    ....

    Btw, I run on Windows 7

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can't use sqlite if Qt development Framework not installed

    Quote Originally Posted by wirasto View Post
    I know that. But not work ..

    myapp.exe
    plugins/qsqlite4.dll
    ....
    ....
    Yes it does, but you need to put the file in the correct location: http://www.qtcentre.org/threads/3712...819#post170819

    Btw, I run on Windows 7
    Good for you

    I know that. But not work ..

    myapp.exe
    plugins/qsqlite4.dll
    ....
    ....

    Btw, I run on Windows 7
    Quite an echo in here.

  5. The following user says thank you to ChrisW67 for this useful post:

    wirasto (5th March 2011)

Similar Threads

  1. DQuest - ORM framework for Qt/Sqlite
    By benlau in forum Qt-based Software
    Replies: 4
    Last Post: 6th October 2010, 17:56
  2. how to make qt use the g++ I installed
    By lwb422 in forum Installation and Deployment
    Replies: 0
    Last Post: 11th April 2010, 15:25
  3. Replies: 1
    Last Post: 13th August 2009, 16:32
  4. can i have both qt3 and qt4 installed
    By illuzioner in forum Installation and Deployment
    Replies: 1
    Last Post: 8th June 2007, 08:50
  5. correctly installed Qt4
    By Salazaar in forum Installation and Deployment
    Replies: 31
    Last Post: 7th May 2007, 07:24

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
  •  
Qt is a trademark of The Qt Company.