Results 1 to 9 of 9

Thread: QPSQL - Driver Not Loaded (WIN XP)

  1. #1
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPSQL - Driver Not Loaded (WIN XP)

    I built my QPSQL plugin. And it resides in same dir as the SQLITE and ODBC ones. In fact it is even in the Registry. However when I run my progem I get the error Driver Not Loaded and the following messages:

    Starting E:/sdf/evtool/release/evtool.exe...
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC

    E:/sdf/evtool/release/evtool.exe exited with code 1

    I have been through the forum and have not found anything that addresses this. They mainly concentrate on building the plugin.

    I deleted the registry keys but that did not work

    Any suggestions?

    Thanks for the help

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    Are PostreSQL libraries in a path where the linker (loader) can find them?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    Thanks for the quick response

    Yes. I have both the include and the lib directories in the PATH. Do I need to set some other environment variable?

    One other note. The code that I am running I originally opened SQLITE database and it worked OK. I just switched databases.
    Last edited by db; 6th September 2009 at 13:20.

  4. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    as far as I remember there is also bin directory, with some needed dlls so try adding it also to PATH
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  5. #5
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    That did not work either. I wonder if I need to recompile PostgreSQL using th MinGW that comes with Qt Creator 2009.01.

  6. #6
    Join Date
    Sep 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    I had the same trouble before yestoday.
    My friend gave me a suggestion to solved this trouble.
    If your application's structure like this:
    ==========
    /bin
    /bin/myApp.exe
    /plugins
    /plugins/sqldrivers
    ==========
    You can puts your driver into the "/plugins/sqldrivers" folder
    and write code in "main.cpp" like this:
    ==========================
    QApplication::addLibraryPath("plugins");
    ==========================
    Another way to solve this trouble:
    Use the "qt.conf" file
    http://doc.trolltech.com/4.5/qt-conf.html
    That all.Good Luck!

  7. #7
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    I don't know how it looks with MinGW because I am using VS, but I solved such problem this way:
    In directory where your exec is create directory named "sqldrivers". Put the qsqlpsql drivers there. Now use the dependency walker to find out which dlls you have to put in your exec dir (taken from postgresql bin package). Put them in your exec dir, not sqldrivers, so dependency walker will not find them anyway in sqldrivers but it is okey. There were more than 10 dlls (I think so...) to copy.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  8. #8
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    Enzo

    Thanks for you suggestion. I have tried that one and it does not work.

    Faldzip

    Also thanks. I tried something similar but I did not think about the DLLs being Postgresql's. I will give Dependency Walker a try.

    You do point out what I think is part of the problem. I do not use VS. I prefer to use MinGW and QT because I switch my code between Win and Linux.

    I though that there version of PostgreSQL was compiled with MinGW. I did try to recompile with latest MinGW but it has trouble doing CreateProcess. Still working that issue as well.

    Sure wish that Nokia would supply the driver PostgreSQL as with SQLITE since it is an open system.

  9. #9
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPSQL - Driver Not Loaded (WIN XP)

    Well I solved my problems. I dropped PostgreSQL and went with MYSQL. I downloaded the server, gui tools, and workbench packages and installed them. Then I creates a simple database with the workbench tool.

    Next I built the MYSQL plugin following the instructions. When I compiled and ran code it work first time!!! All this took 2.5 hours.... not bad compard to the days I have spent with PostgreSQL getting nowhere.

    Thanks for all the help and suggestions

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem with Qt 4.5.1 and Windows 7 RC (Build 7100)
    By Paladin12 in forum Installation and Deployment
    Replies: 0
    Last Post: 13th May 2009, 09:58
  3. mysql 5 connection
    By GuL in forum Newbie
    Replies: 37
    Last Post: 18th August 2008, 15:11
  4. exception at 0x65100c40 (QtGuid4.dll)
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2007, 17:10
  5. Can't find QPSQL driver!!
    By brevleq in forum Qt Programming
    Replies: 9
    Last Post: 30th October 2007, 00:29

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.