Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How Qt loading SQL drivers?
QtWS25 Last Chance

How Qt loading SQL drivers?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 3.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxim.prishchepa
    wrote on last edited by
    #1

    Hi All! Have a trouble!
    Work at MSVC2008, Qt 4.8.0, DB: PostgreSQL 8.4;
    I'm compile driver for this db, copy it to the plugin folder at the Qt Dir. Then copy dirvers and dll-s (from bin folder postgre) to the Debug folder, which contains exe file of my application. When i execute a application from explorer (for example) - it's all right, all work correct, but when i try execute application for debuging (from Visual studio) - this app write at console:
    @QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QPSQL7 QPSQL @
    Why that? what i do wrong? I try copy drivers and dll-s to the app folder, try add this files to the PATH, and to the enviroment (at MSVC) - nothing of that are solve this issue.

    Thx 4 answers!

    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soroush
      wrote on last edited by
      #2

      bq. Then copy dirvers and dll-s (from bin folder postgre) to the Debug folder, which contains exe file of my application.

      I had have same problem in Windows. Make sure you put libs in currect place.

      You should copy database dlls (qmysql4.dll, qpspsql4.dll, etc) in a path like this:
      @<application-dir>/sqldrivers/@
      And other libraries, e.g main Qt libraries (QtGui4.dll , etc.):
      @<application-dir>/@

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxim.prishchepa
        wrote on last edited by
        #3

        yep, i do exactly like you write! but when i try execute program by debugger - have a message: driver not loaded :(

        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

        1 Reply Last reply
        0
        • S Offline
          S Offline
          soroush
          wrote on last edited by
          #4

          did you compile debugging symbols for DBMS plugin?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maxim.prishchepa
            wrote on last edited by
            #5

            yep, i compile 2 dlls and libs for release and for debug

            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

            1 Reply Last reply
            0
            • S Offline
              S Offline
              soroush
              wrote on last edited by
              #6

              Sorry, can't help you.

              compile your plugins both debug and release,

              add to .pro file,

              @
              qt += sql
              @

              compile your Qt application with same compiler as you just compiled libraries,

              put your plugin libraries in right place,

              copy any other libraries provided by DBMS vendor beside your application.

              This works properly for me.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved