Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How Qt loading SQL drivers?

    General and Desktop
    2
    6
    3536
    Loading More Posts
    • 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
      maxim.prishchepa last edited by

      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 Reply Quote 0
      • S
        soroush last edited by

        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 Reply Quote 0
        • M
          maxim.prishchepa last edited by

          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 Reply Quote 0
          • S
            soroush last edited by

            did you compile debugging symbols for DBMS plugin?

            1 Reply Last reply Reply Quote 0
            • M
              maxim.prishchepa last edited by

              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 Reply Quote 0
              • S
                soroush last edited by

                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 Reply Quote 0
                • First post
                  Last post