Results 1 to 20 of 35

Thread: use qpsql

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default use qpsql

    Hi everybody,
    QT: 4.1.3
    OS: WIN XP

    I tried to connect to my sql server via odbc and it works perfect. I have installed postgre 8.1 on my machine and build the plugin for postgre. I get a new file "qsqlpsql.dll". So i would like to connect it to a Postgre database. I get the known error: Driver not loaded, driver not loaded.
    Here my code:
    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
    2. db.setHostName("localhost");
    3. db.setDatabaseName("inventar");
    4. db.setUserName("postgres");
    5. db.setPassword("tekoteko");
    6. if(!db.open())
    7. {
    8. QMessageBox::information(this,"",db.lastError().text());
    9. return false;
    10. }
    11. else
    12. {
    13. . . .
    To copy to clipboard, switch view to plain text mode 

    What could i try to make my connection running?

    Thanks
    Think DigitalGasoline

  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: use qpsql

    Check the dependencies of the driver using dependency walker. Maybe the plugin can't find some library it needs.

  3. #3
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: use qpsql

    Hi wysota!!
    I downloaded dependency walker and check qsqlpsql.dll
    I get a yellow question mark for "LIBPQ.dll", what should i do now?
    Last edited by raphaelf; 5th July 2006 at 11:41.
    Think DigitalGasoline

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use qpsql

    Quote Originally Posted by raphaelf
    I get a yellow question mark for "LIBPQ.dll", what should i do now?
    Find it and copy to the same directory where the executable is.

  5. #5
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: use qpsql

    Hi Jacek,
    I copyed the dll to the directory and i get the same error "driver not loaded"
    Think DigitalGasoline

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use qpsql

    Quote Originally Posted by raphaelf
    I copyed the dll to the directory and i get the same error "driver not loaded"
    AFAIR you need more than one DLL. Check what DLLs libpq.dll requires.

  7. #7
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: use qpsql

    Hi Jacek,
    I copied all dlls from postgres and i get the same error
    With QT3.2.1 i can remenber that i had no problem to connect me to my postgre database.
    Do QT4 support Postgre 8.1?
    What could i try now??
    Think DigitalGasoline

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use qpsql

    Quote Originally Posted by raphaelf
    Do QT4 support Postgre 8.1?
    Of course it does. Which Qt version do you have exactly?

  9. #9
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: use qpsql

    Hi!!
    QT4.1.3 Open Source Edition
    MINGW 4.1
    Think DigitalGasoline

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: use qpsql

    Quote Originally Posted by raphaelf
    QT4.1.3 Open Source Edition
    I had no problems with this version. To be able to load the plugin, I had to add libeay32.dll, libpq.dll and libssl32.dll

  11. #11
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: use qpsql

    Hi everybody
    I add these dlls to my path: libeay32.dll, libpq.dll and qsqlpsql.dll
    I could not find libssl32.dll on my system.
    but i am not able to connect to my postgre databse. What could i try to solve my problem?

    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
    2. db.setHostName("localhost");
    3. db.setDatabaseName("inventarMp");
    4. db.setUserName("postgres");
    5. db.setPassword("");
    6. if(!db.open())
    7. {
    8. QMessageBox::information(this,"",db.lastError().text());
    9. return false;
    10. }
    11. else
    12. {..
    To copy to clipboard, switch view to plain text mode 
    ERROR: Driver not loaded
    Think DigitalGasoline

Similar Threads

  1. Qt 4.1.4 plugin QPSQL
    By jcr in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd June 2006, 22:55

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.