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 and MS Sql Server
Forum Update on Monday, May 27th 2025

Qt and MS Sql Server

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 3.0k 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by mrdebug
    #1

    Can someone show and example on how to connect to a ms sql server from Qt, without to use odbc?
    Is there a library to connect to all the sql server type similar to ado?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    raven-worxR 1 Reply Last reply
    0
    • mrdebugM mrdebug

      Can someone show and example on how to connect to a ms sql server from Qt, without to use odbc?
      Is there a library to connect to all the sql server type similar to ado?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @mrdebug said in Qt and MS Sql Server:

      Can someone show and example on how to connect to a ms sql server from Qt, without to use odbc?

      i am not sure if that this is possible at all (with Qt's default sql plugins).
      Whats wrong with ODBC?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by mrdebug
        #3

        Because my software has to be easy to install.
        During the installation the customer has to extract all the data from the old software and it is not possible that the customer has to create the odbc dsn.
        The best way is to use ado but QAxObject does not work.
        Strangely QAxObject works through odbc but not with a ado string connection to a ms sql server.

        I did a research of an external library to do this but I haven't found nothing.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

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

          Hi, before I switched to Qt I used MFC, and when I needed SQL Server connectivity I included 2 files in my project: ado2.h and ado2.cpp, they had a good interface/bridge between C++ and ADO.

          You could try it, article here

          1 Reply Last reply
          0
          • mrdebugM Offline
            mrdebugM Offline
            mrdebug
            wrote on last edited by
            #5

            Many thanks!
            I see it is necessary to register to the website. Is there another place where I can download it?

            Need programmers to hire?
            www.labcsp.com
            www.denisgottardello.it
            GMT+1
            Skype: mrdebug

            1 Reply Last reply
            0
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by
              #6

              Finally I had to implement directly the ado api, found in the Microsoft website.
              I did not understood why QAXObject works only through odbc.

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

              1 Reply Last reply
              0
              • JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                Does this shed some light?

                https://stackoverflow.com/questions/41198357/how-to-use-adodb-connection-in-qt-and-query-database

                1 Reply Last reply
                0
                • mrdebugM Offline
                  mrdebugM Offline
                  mrdebug
                  wrote on last edited by
                  #8

                  Unfortunately not. My problem is related to the access at a MS Sql Server database through Ado across the network, without using odbc.

                  Need programmers to hire?
                  www.labcsp.com
                  www.denisgottardello.it
                  GMT+1
                  Skype: mrdebug

                  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