+ Reply to Thread
Results 1 to 5 of 5

Thread: Sqlite driver not loading

  1. #1
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Sqlite driver not loading

    Trying to deploy an application on Windows but Sqlite driver is not loading.
    After searching the forum, I have it set up as follows:

    Executable and other files directory is C:\HRLogger_Release
    Drivers qsqlite4.dll and sqlite3.dll are in C:\HRLogger_Release\sqldrivers

    Using this code:
    Qt Code:
    1. QString applPath = QCoreApplication::applicationDirPath();
    2. applPath.append("/sqldrivers");
    3. qApp->addLibraryPath(applPath);
    4. qDebug() << "applPath is now " << applPath;
    To copy to clipboard, switch view to plain text mode 

    Produces this:
    applPath is now "C:/HRLogger_Release/sqldrivers"
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:

    What am I missing here?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,002 Times in 912 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Sqlite driver not loading

    as far as I remember sqlite3.dll has to be in the root directory. Alternatively you can build Qt with on-board-sqlite. Then you wont face such kind of problems.

  3. #3
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Sqlite driver not loading

    Thanks Lykurg but copying sqlite3.dll to the application root directory had no effect.
    I should have explained that the application executable and associated files are being generated on a Windows machine with a default Qt installation that included sqlite. Then the release directory is copied over to the target Windows machine which does not have Qt installed.
    The application runs fine on the development machine - from either debug or release build.
    Any other ideas?

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,002 Times in 912 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Sqlite driver not loading

    Hm which version of Qt are you using? Because 4.6.2 had build in support for sqlite. From where do you get the Qt dll's? make sure you have take them from C:\Qt\2010.02.1\qt\bin.

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

    waynew (23rd May 2010)

  6. #5
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Sqlite driver not loading

    Thanks Lykurg! Upgraded to 4.6.2 and deployed successfully! I can't believe how fast this database application runs on an old Lenovo notebook.
    Qt rocks.

+ Reply to Thread

Similar Threads

  1. Loading and saving in-memory SQLITE databases
    By miraks in forum Qt Programming
    Replies: 10
    Last Post: 27th April 2010, 22:24
  2. Loading SQLite plugin. Again!
    By miwarre in forum Newbie
    Replies: 5
    Last Post: 12th November 2009, 11:23
  3. Embed SQLite driver
    By NoRulez in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2009, 10:41
  4. SQLite driver unavailable
    By kandalf in forum Installation and Deployment
    Replies: 5
    Last Post: 11th February 2009, 17:36
  5. Error Loading MySql Driver in 4.3.4
    By perrigo in forum Qt Programming
    Replies: 5
    Last Post: 26th March 2008, 15:38

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