QOCDB + MacOS + Access = crash at open()
Unsolved
General and Desktop
-
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!
-
Hi, freetds works fine with SQL Server, but is no good for opening an Access database, you need a Windows computer :-(