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. QOCDB + MacOS + Access = crash at open()
Forum Updated to NodeBB v4.3 + New Features

QOCDB + MacOS + Access = crash at open()

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 544 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
    ParalaX
    wrote on last edited by
    #1

    Hi everyone!

    I've been having an issue while trying to connect on a simple access database on macOS. I use qt 5.11 that I installed with "brew" in wich I copied a compiled version of the QOSDB plugin, compiled also with qt 5.11 from the sources.

    So my code is this:

     QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3");
      db.setDatabaseName(fileName.prepend("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="));
    
      qDebug() << "Is driver available:" << db.isDriverAvailable("QODBC");
      qDebug() << "Drivers:" << db.drivers();
      qDebug() << "Db is valid:" << db.isValid();
      qDebug() << "Last error:" << db.lastError();
    
    if(db.open())
        qDebug() << "oK";
      else
        qDebug() << db.lastError().text();
    

    And the result is this:

    "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=/Users/paralax/CloudStation/Projects/Libraries/Altium/Antenna.accdb"
    
    Is driver available: true
    Drivers: ("QSQLITE", "QODBC", "QODBC3")
    Db is valid: true
    Last error: QSqlError("", "", "")
    

    Unluckily, It crashes on the line db.open(). And the debugger is of no help :s

    I have unixocdb and freedts installed with brew. I guess there is a problem with my environment setup, but I don't know where. Any idea?

    Thanks in advance!

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

      Hi, freetds works fine with SQL Server, but is no good for opening an Access database, you need a Windows computer :-(

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

        Damit microsoft!

        Thanks for your answer. Isn't there any other way to connect to those database? Any other lib or plugin of some sort?

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

          Well, I had the same problem some time again on Ubuntu, and on Linux there's MDB Tools which opened my Access files ok.

          With a bit of luck MDB Tools could be available via Homebrew...

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved