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. How can i use microsoft access database in Qt?
QtWS25 Last Chance

How can i use microsoft access database in Qt?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 9.2k 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.
  • P Offline
    P Offline
    pratik041
    wrote on last edited by
    #1

    I was trying the following but i get (success = false.)
    @ QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DSN='';DBQ=C:/Users/pratik041/MyDocuments/pratik.accdb");
    bool Success = db.open();
    qDebug()<<Success;
    @ what may be wrong in this?

    Pratik Agrawal

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      The fact that you're trying to use the Sqlite driver with an ODBC handle?

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pratik041
        wrote on last edited by
        #3

        [quote author="peppe" date="1324924360"]The fact that you're trying to use the Sqlite driver with an ODBC handle? (hint, ihnt)[/quote]
        but if i am using QODBC driver it is showing the driver is not loaded.

        Pratik Agrawal

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rahul Das
          wrote on last edited by
          #4

          @QSqlDatabase::isDriverAvailable("QODBC")@

          will help you to make sure if ODBC driver is 'really' there.


          Declaration of (Platform) independence.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pratik041
            wrote on last edited by
            #5

            I have checked. It is not available. So what i have to do now?

            Pratik Agrawal

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on last edited by
              #6

              Build the ODBC plugin.

              EDIT : you can start here : http://developer.qt.nokia.com/doc/qt-4.8/sql-driver.html#how-to-build-the-odbc-plugin-on-windows


              Declaration of (Platform) independence.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pratik041
                wrote on last edited by
                #7

                where I have to write that in command prompt in the project or any other place?

                Pratik Agrawal

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Rahul Das
                  wrote on last edited by
                  #8

                  startmenu -> All Programs -> Qt SDK -> Desktop -> cmd


                  Declaration of (Platform) independence.

                  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