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. Qt 5.6.0 no odbc driver availabe - please vote for this bugfix
Qt 6.11 is out! See what's new in the release blog

Qt 5.6.0 no odbc driver availabe - please vote for this bugfix

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 5 Posters 8.3k Views 4 Watching
  • 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by Andy314
    #1

    Hello,
    I am on the way from Qt 5.5.1 to Qt 5.6.0, use MSVC2013.
    The program runs with the old version fine but with the new Qt I get no ODBC driver.

        bool ok=QSqlDatabase::isDriverAvailable("QODBC");
        if(!ok)
        {
            ErrorMsg="No ODBC driver available!";
            return 1;
        }
    

    Whats the problem ?

    Here is the vote for the bugfix:
    https://bugreports.qt.io/browse/QTBUG-49420

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, I also miss it (have several apps that depend on it) but it seems the ODBC plugin is not popular enough to ship, here it's reported as a bug
      The solution is to download Qt's source code and build it yourself.

      Andy314A 1 Reply Last reply
      2
      • hskoglundH hskoglund

        Hi, I also miss it (have several apps that depend on it) but it seems the ODBC plugin is not popular enough to ship, here it's reported as a bug
        The solution is to download Qt's source code and build it yourself.

        Andy314A Offline
        Andy314A Offline
        Andy314
        wrote on last edited by Andy314
        #3

        Hello @hskoglund,
        not popular ? What is an alternative way to connect to a MS-Access-DB with Qt ?
        Damned, Qt changed from version one version to another, no more usable.
        I would classify it as a clear bug to leave such a important deployment!

        Building Qt from source - did you have ever success with it. Is there a make switch to enable ODBC ?

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Hi, well the kosher way is described here , basically download Qt's source code and build just the plugin.

          But since I am a lazy person I opted for the more hazardous route of binary patching Qt's 5.5.1 version of qsqlodbc.dll, works fine for me (it seems so anyway :-)
          So here's what I did:

          Note: Warning! What I am describing here is NOT supported or recommended:

          1. Copy qsqlodbc.dll from the 5.5.1 ..\plugins\sqldrivers directory into your 5.6. ..\plugins\directory
          2. Using your favorite hex/binary editor, locate the 2 consecutive bytes at 0xE65 and 0xE66 picture here
          3. Change them from 01 05 to 00 06 another picture here
          4. Save and voila!
          Andy314A 1 Reply Last reply
          2
          • hskoglundH hskoglund

            Hi, well the kosher way is described here , basically download Qt's source code and build just the plugin.

            But since I am a lazy person I opted for the more hazardous route of binary patching Qt's 5.5.1 version of qsqlodbc.dll, works fine for me (it seems so anyway :-)
            So here's what I did:

            Note: Warning! What I am describing here is NOT supported or recommended:

            1. Copy qsqlodbc.dll from the 5.5.1 ..\plugins\sqldrivers directory into your 5.6. ..\plugins\directory
            2. Using your favorite hex/binary editor, locate the 2 consecutive bytes at 0xE65 and 0xE66 picture here
            3. Change them from 01 05 to 00 06 another picture here
            4. Save and voila!
            Andy314A Offline
            Andy314A Offline
            Andy314
            wrote on last edited by Andy314
            #5

            Hello @hskoglund ,
            wow indeed it works.
            I found for the debug-dll one must change the second occurrence of 0105 at FACB.

            I hope this will be fixed in the following Qt version(s) and there is no general decision to leave it. I think this trick will not work forever. Please let it in !!!
            ODBC is important for a lot of people I think. Without it Qt would be no more usable for me.
            Thank you very much for the quick help !!!!

            mrjjM 1 Reply Last reply
            0
            • Andy314A Andy314

              Hello @hskoglund ,
              wow indeed it works.
              I found for the debug-dll one must change the second occurrence of 0105 at FACB.

              I hope this will be fixed in the following Qt version(s) and there is no general decision to leave it. I think this trick will not work forever. Please let it in !!!
              ODBC is important for a lot of people I think. Without it Qt would be no more usable for me.
              Thank you very much for the quick help !!!!

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Andy314
              hi, u should go and vote for it.
              To make it important.
              Else it will most likely not be included ever again.

              Andy314A 1 Reply Last reply
              2
              • mrjjM mrjj

                @Andy314
                hi, u should go and vote for it.
                To make it important.
                Else it will most likely not be included ever again.

                Andy314A Offline
                Andy314A Offline
                Andy314
                wrote on last edited by
                #7

                Hi @mrjj ,
                vote the messages in thread or what do you mean ? Can I vote for features ?

                mrjjM 1 Reply Last reply
                0
                • Andy314A Andy314

                  Hi @mrjj ,
                  vote the messages in thread or what do you mean ? Can I vote for features ?

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Andy314
                  hi
                  if u look at the
                  https://bugreports.qt.io/browse/QTBUG-49420
                  to the right. there is vote.
                  So if u login/make account. u can vote on issue/bug.
                  If many vote for it, it does get more attention.
                  so far its
                  Votes: 3 Vote for this issue

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    MartinChan
                    wrote on last edited by
                    #9

                    As a rookie in QT Forum,I have to say it's nervous to reply to my first comment.

                    Now I'm faced with the same question:No OBDC drive for the sql database.But I am not too conscious of the configure code:

                    cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
                    qmake odbc.pro
                    nmake

                    I mean,not only I don't know its meaning ,and** more important,I don't know where to use it??(copy and paste it on the pro file which in your project?or some place else?)**Forgive me I am not too practical of QT,all I learned during my college life is 48 hours C++...

                    And I am not sure it's the right place to ask for help,and I don't know how to insert a picture in my comment(hyperlink???)...

                    mrjjM 1 Reply Last reply
                    0
                    • M MartinChan

                      As a rookie in QT Forum,I have to say it's nervous to reply to my first comment.

                      Now I'm faced with the same question:No OBDC drive for the sql database.But I am not too conscious of the configure code:

                      cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
                      qmake odbc.pro
                      nmake

                      I mean,not only I don't know its meaning ,and** more important,I don't know where to use it??(copy and paste it on the pro file which in your project?or some place else?)**Forgive me I am not too practical of QT,all I learned during my college life is 48 hours C++...

                      And I am not sure it's the right place to ask for help,and I don't know how to insert a picture in my comment(hyperlink???)...

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by mrjj
                      #10

                      @MartinChan
                      Hi and welcome
                      Don't be nervous. we are very friendly here.
                      You will do it a cmd prompt/Shell
                      (start, type cmd , it shows command prompt)
                      If you are using visual compiler, it should be its cmd prompt version.

                      lets see
                      cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
                      this will go to the odbc directory
                      type dir and check there is the odbc.pro
                      and then you build the odbc driver.

                      If it dont know qmake, you might need to add to PATH the location of qmake.exe.

                      You can upload images to say postimage.org or other places. there is no direct upload here.

                      Update:
                      You can also open odbc.pro in Creator. That might also just work.

                      M 1 Reply Last reply
                      0
                      • mrjjM mrjj

                        @MartinChan
                        Hi and welcome
                        Don't be nervous. we are very friendly here.
                        You will do it a cmd prompt/Shell
                        (start, type cmd , it shows command prompt)
                        If you are using visual compiler, it should be its cmd prompt version.

                        lets see
                        cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
                        this will go to the odbc directory
                        type dir and check there is the odbc.pro
                        and then you build the odbc driver.

                        If it dont know qmake, you might need to add to PATH the location of qmake.exe.

                        You can upload images to say postimage.org or other places. there is no direct upload here.

                        Update:
                        You can also open odbc.pro in Creator. That might also just work.

                        M Offline
                        M Offline
                        MartinChan
                        wrote on last edited by
                        #11

                        @mrjj
                        Wow,awesome reply speed~I will try it soon and wish it work~~;)~You're very nice~~~~

                        Another question:I am not sure about the relationship between the Qt and its opensource file:Before this question , I just use the Online Installer that Qt.io provided(MSVC2013,64bit),but in this case I found no QtBase folder under MSVC2013_64 folder,so I have to download the whole qtbase opensource...But this progress really confuses me:Is Qt just provided separated open source to people for choice? (@_@;)
                        Maybe it's time to reinstall the QT again...=.=

                        mrjjM 1 Reply Last reply
                        0
                        • M MartinChan

                          @mrjj
                          Wow,awesome reply speed~I will try it soon and wish it work~~;)~You're very nice~~~~

                          Another question:I am not sure about the relationship between the Qt and its opensource file:Before this question , I just use the Online Installer that Qt.io provided(MSVC2013,64bit),but in this case I found no QtBase folder under MSVC2013_64 folder,so I have to download the whole qtbase opensource...But this progress really confuses me:Is Qt just provided separated open source to people for choice? (@_@;)
                          Maybe it's time to reinstall the QT again...=.=

                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @MartinChan
                          Hi
                          Using the installer, there is also option to install the source code.
                          There is a maintenance tool. I think you can get the source running that and add it.

                          Since you took the MSVC2013 Qt, I assume you have visual studio Installed ?
                          (already)

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            MartinChan
                            wrote on last edited by
                            #13

                            Yes~I already had installed VS2013~

                            FYI:Users in China can't use the postimage.org (@ @),but luckily we can have other similar websites like this.Haha~~~

                            mrjjM 1 Reply Last reply
                            0
                            • M MartinChan

                              Yes~I already had installed VS2013~

                              FYI:Users in China can't use the postimage.org (@ @),but luckily we can have other similar websites like this.Haha~~~

                              mrjjM Offline
                              mrjjM Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @MartinChan
                              Ok. super.
                              Im not visual studio user but I recall it having its
                              own command prompt with all paths setup.
                              You should do the command in that one.

                              Oh, thats odd. postimage.org is not really dangerous but I guess
                              there can be many reasons :)

                              M 1 Reply Last reply
                              0
                              • mrjjM mrjj

                                @MartinChan
                                Ok. super.
                                Im not visual studio user but I recall it having its
                                own command prompt with all paths setup.
                                You should do the command in that one.

                                Oh, thats odd. postimage.org is not really dangerous but I guess
                                there can be many reasons :)

                                M Offline
                                M Offline
                                MartinChan
                                wrote on last edited by MartinChan
                                #15

                                @mrjj
                                Final worked!!!Here is the pic.Although it still has some other problems ,but no more"QODBC driver is not available"makes me feel really good~~

                                I really want to share the way I use to solve this problem(all of you know due to Qt is an open system so it changed all the time ,but I really want they add ODBC to it in the next version!)Here is the way to do with Qt5.6 and MSVC2013(64bit):

                                • First,make sure you have download the qt version includes the whole opensource(or you can download it separated maybe ,I didn't try it)what else ,add the PATH(This word prepared for the rookie like me) of your qt.

                                • Second,open cmd and type cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
                                  to get the folder includes odbc.pro file .
                                  (Make sure the PATH thing)then type qmake odbc.pro

                                • Here comes another thing ,u must call the vcvarsall.bat(or vcvar32.bat) to make the nmake,here comes the question:where to find this bat file?Commonly it's your Microsoft Visual Studio 2013\VC folder ,like my computer,it's D:\Visual Studio\Visual Studio2013\VC.So don't forget to execute it before the first step,then u can make the nmake(I copy this bat file to the odbc.pro's folder,I didn't know if it has the impact. )

                                • The you can find Qtbase\plugins has created a new sqldriver folder,copy all the things in it to the C:\Qt\5.6\msvc2013_64\plugins\sqldrivers (namely your compiler folder and the sqldrivers folder under it ),then ,real Done.

                                FYI:Thx for the people in this topic,especially @mrjj ,I really get a good feeling about that,haha~~

                                mrjjM 1 Reply Last reply
                                2
                                • M MartinChan

                                  @mrjj
                                  Final worked!!!Here is the pic.Although it still has some other problems ,but no more"QODBC driver is not available"makes me feel really good~~

                                  I really want to share the way I use to solve this problem(all of you know due to Qt is an open system so it changed all the time ,but I really want they add ODBC to it in the next version!)Here is the way to do with Qt5.6 and MSVC2013(64bit):

                                  • First,make sure you have download the qt version includes the whole opensource(or you can download it separated maybe ,I didn't try it)what else ,add the PATH(This word prepared for the rookie like me) of your qt.

                                  • Second,open cmd and type cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
                                    to get the folder includes odbc.pro file .
                                    (Make sure the PATH thing)then type qmake odbc.pro

                                  • Here comes another thing ,u must call the vcvarsall.bat(or vcvar32.bat) to make the nmake,here comes the question:where to find this bat file?Commonly it's your Microsoft Visual Studio 2013\VC folder ,like my computer,it's D:\Visual Studio\Visual Studio2013\VC.So don't forget to execute it before the first step,then u can make the nmake(I copy this bat file to the odbc.pro's folder,I didn't know if it has the impact. )

                                  • The you can find Qtbase\plugins has created a new sqldriver folder,copy all the things in it to the C:\Qt\5.6\msvc2013_64\plugins\sqldrivers (namely your compiler folder and the sqldrivers folder under it ),then ,real Done.

                                  FYI:Thx for the people in this topic,especially @mrjj ,I really get a good feeling about that,haha~~

                                  mrjjM Offline
                                  mrjjM Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  @MartinChan
                                  Good work! :)

                                  1 Reply Last reply
                                  0
                                  • Leo ZL Offline
                                    Leo ZL Offline
                                    Leo Z
                                    wrote on last edited by
                                    #17

                                    Hi, is anyone still here? I ran into the same problem, but it can't be solved by the method posted here. It went well when use qmake, but when use nmake, some error happened. Can anyone help me? I also post my question in this link with a screen shot.

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      MartinChan
                                      wrote on last edited by
                                      #18

                                      First,sorry for not clearly clarify the first step.

                                      The first is to execute the vcvarsall.bat(or vcvars32.bat,according to the version you installed)to make sure you can use nmake lately.So what you do first is like:

                                      cd directory_of_your_vs_vc/vcvarsall.bat(vcvars32.bat may under the bin folder) 
                                      

                                      after that you can use nmake and nmake install orider.

                                      Leo ZL 1 Reply Last reply
                                      1
                                      • M MartinChan

                                        First,sorry for not clearly clarify the first step.

                                        The first is to execute the vcvarsall.bat(or vcvars32.bat,according to the version you installed)to make sure you can use nmake lately.So what you do first is like:

                                        cd directory_of_your_vs_vc/vcvarsall.bat(vcvars32.bat may under the bin folder) 
                                        

                                        after that you can use nmake and nmake install orider.

                                        Leo ZL Offline
                                        Leo ZL Offline
                                        Leo Z
                                        wrote on last edited by
                                        #19

                                        @MartinChan
                                        I tried both and neither of them work..., the same error came out when applying them.

                                        M 1 Reply Last reply
                                        0
                                        • Leo ZL Leo Z

                                          @MartinChan
                                          I tried both and neither of them work..., the same error came out when applying them.

                                          M Offline
                                          M Offline
                                          MartinChan
                                          wrote on last edited by
                                          #20

                                          @Leo-Z awkward it didn't work,but nmake is the order related to the VS,i don't know if it is influenced by your environment config,maybe you can post a pic to show what vc folder have and the error when you configure.

                                          Leo ZL 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