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. Is it not possible to open M.S. access file?
QtWS25 Last Chance

Is it not possible to open M.S. access file?

Scheduled Pinned Locked Moved Solved General and Desktop
27 Posts 7 Posters 8.9k 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.
  • R Offline
    R Offline
    rockon209
    wrote on 11 May 2017, 07:31 last edited by
    #16

    @Andy314
    I am using Qt 5.7.0

    A 1 Reply Last reply 11 May 2017, 07:38
    0
    • R rockon209
      11 May 2017, 07:31

      @Andy314
      I am using Qt 5.7.0

      A Online
      A Online
      Andy314
      wrote on 11 May 2017, 07:38 last edited by Andy314 5 Nov 2017, 07:53
      #17

      Hi @rockon209
      the QtCompany had the idea to do not distribute the binarys for the ODBC driver anymore. That was in Version 5.5 and 5.6 I think. I initiated a discussion about it. The result was that the driver should be integrated again. I dont know if this is in 5.7 really the case.

      Look if you have in the path like C:\Qt2\5.6\msvc2015\plugins\sqldrivers
      the qsqlodbc files.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rockon209
        wrote on 11 May 2017, 08:06 last edited by
        #18

        @Andy314

        yes the file is present in the path.

        A 1 Reply Last reply 11 May 2017, 08:14
        0
        • R rockon209
          11 May 2017, 08:06

          @Andy314

          yes the file is present in the path.

          A Online
          A Online
          Andy314
          wrote on 11 May 2017, 08:14 last edited by
          #19

          Hello @rockon209,
          oh I am happy :-)

          Now your Problem:
          It must work ! I use it since 1 year.

          We must find the error systhematic.
          First you should try a connection via the windows Windows-ODBC tool.
          I there is something wrong we must not look on Qt.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rockon209
            wrote on 11 May 2017, 08:19 last edited by
            #20

            @Andy314
            How to do that bcoz i new to this database access. I dont know how it works. Could you help me?

            A D 2 Replies Last reply 11 May 2017, 08:26
            0
            • R rockon209
              11 May 2017, 08:19

              @Andy314
              How to do that bcoz i new to this database access. I dont know how it works. Could you help me?

              A Online
              A Online
              Andy314
              wrote on 11 May 2017, 08:26 last edited by
              #21

              Hi @rockon209

              Search in Windows for "ODBC".
              Open the Program, dont know the english name. Something like "ODBC-Datasource 32-bit"
              Tabpage Drivers: Is there a entry like Microsoft Access Driver (*.mdb, *.accdb) ?

              more later...

              1 Reply Last reply
              0
              • R rockon209
                11 May 2017, 08:19

                @Andy314
                How to do that bcoz i new to this database access. I dont know how it works. Could you help me?

                D Offline
                D Offline
                Devopia53
                wrote on 11 May 2017, 08:30 last edited by Devopia53 5 Nov 2017, 11:30
                #22

                @rockon209

                Hi.

                Perhaps, you have a very minor problem.
                Compare the connection strings below.

                db.setDatabaseName("Driver={Microsoft Access Driver(*.mdb, *.accdb)}; DBQ=C:/MyFolder/Database1.accdb;"); // It's not OK!
                
                db.setDatabaseName("Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:/MyFolder/Database1.accdb;"); // It's OK!
                

                The ODBC driver is installed by default on Windows.

                A 1 Reply Last reply 11 May 2017, 08:37
                1
                • R Offline
                  R Offline
                  rockon209
                  wrote on 11 May 2017, 08:36 last edited by
                  #23

                  @Andy314

                  Yes entry is there in the Drivers Tab

                  @Devopia53
                  i tried it doest work same error again

                  1 Reply Last reply
                  0
                  • D Devopia53
                    11 May 2017, 08:30

                    @rockon209

                    Hi.

                    Perhaps, you have a very minor problem.
                    Compare the connection strings below.

                    db.setDatabaseName("Driver={Microsoft Access Driver(*.mdb, *.accdb)}; DBQ=C:/MyFolder/Database1.accdb;"); // It's not OK!
                    
                    db.setDatabaseName("Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:/MyFolder/Database1.accdb;"); // It's OK!
                    

                    The ODBC driver is installed by default on Windows.

                    A Online
                    A Online
                    Andy314
                    wrote on 11 May 2017, 08:37 last edited by
                    #24

                    Jup, use exactly the name shown in the ODBC tool !!!!!

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      rockon209
                      wrote on 11 May 2017, 08:48 last edited by
                      #25

                      ok thank you very much guys it worked i was not using the proper syntax.
                      Thank you very much.

                      A 1 Reply Last reply 11 May 2017, 09:16
                      0
                      • R rockon209
                        11 May 2017, 08:48

                        ok thank you very much guys it worked i was not using the proper syntax.
                        Thank you very much.

                        A Online
                        A Online
                        Andy314
                        wrote on 11 May 2017, 09:16 last edited by Andy314 5 Nov 2017, 09:24
                        #26

                        Go in the ODBC tool to the File-DSN tab.

                        Top right button like Add or Create new
                        choose the Access odbc driver -> click >>
                        as next set a filename -> click >>
                        next windows choose a *.accdb file
                        ready -> you have a DSN file which defines the connection.

                        I thought the ODBC tool has a function to test this connection directly, but it has not. So a file.dsn testing program would be nice ....
                        I found out a testing methode with Excel Data Tab->Extern Data -> Data connection Assistant -> ODBC DSN -> and choosed the pervious integrated dsn-file.

                        Nevertheless you should use the content of this file as the connect string in Qt.
                        only DRIVER and DBQ are important here.

                        and you should check in Qt:
                        ```
                        bool ok=QSqlDatabase::isDriverAvailable("QODBC");
                        if(!ok)
                        {
                        ErrorMsg="No ODBC driver available!";
                        return 1;
                        }

                        1 Reply Last reply
                        1
                        • K Offline
                          K Offline
                          konglyn
                          wrote on 9 Oct 2017, 08:48 last edited by
                          #27

                          i guess your os is win7 x64 and you are using Qt 5.7 x64 with access 2013 x86
                          try installing access 2013 runtime x64 , you can download it from microsoft

                          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