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. Odbc driver - can't get it work
Forum Updated to NodeBB v4.3 + New Features

Odbc driver - can't get it work

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 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.
  • M Offline
    M Offline
    metRo_
    wrote on last edited by
    #1

    I have MS SQL Server 2008 R2 installed in my PC and I want to connect my qt application to it but when I do:
    @qDebug() << QSqlDatabase::drivers();@

    it only return ("QSQLITE"). I read in the "documentation":http://doc.qt.nokia.com/4.7-snapshot/sql-driver.html that I need to compile the plugin but I can't get it work.

    It appear to have the dll:
    C:\QtSDK\Desktop\Qt\4.8.1\mingw\plugins\sqldrivers>dir
    Volume in drive C has no label.
    Volume Serial Number is 94CE-CCA3

    Directory of C:\QtSDK\Desktop\Qt\4.8.1\mingw\plugins\sqldrivers

    27-05-2012 18:58 <DIR> .
    27-05-2012 18:58 <DIR> ..
    27-05-2012 18:57 527.360 qsqlite4.dll
    27-05-2012 18:57 1.872.165 qsqlited4.dll
    27-05-2012 18:57 163.840 qsqlodbc4.dll
    27-05-2012 18:57 997.135 qsqlodbcd4.dll
    4 File(s) 3.560.500 bytes
    2 Dir(s) 79.757.148.160 bytes free

    I tried to run:
    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\odbc>qmake odbc.pro

    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\odbc>nmake
    'nmake' is not recognized as an internal or external command,
    operable program or batch file.

    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\odbc>make
    'make' is not recognized as an internal or external command,
    operable program or batch file.

    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\odbc>

    CAn you help me?

    Thanks :s

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      "nmake" is the make utility for the Microsoft C++ tool chain. You are, presumably, using the bundled MingW compiler. The equivalent command is:
      @mingw32-make @

      You will also need to run:
      @ mingw32-make install @

      after it is built to install the plugin. If you want a release version of the plugin you should repeat the qmake command with "CONFIG+=release" as an extra argument, make, and install.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        metRo_
        wrote on last edited by
        #3

        Thanks :) Works great :)

        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