Answer the question
In order to leave comments, you need to log in
How to work with ODBC in Ubuntu 15.04?
Trying to open a database
Selecting a *.mdb file I get an error
on Ubuntu 15.04
[unixODBC][Driver Manager]Data source name not found, and no default driver specified QODBC3: Unable to connect
DRIVERS : ("QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3")
bool DataModel::connectDB(const QString &dBName)
{
db = QSqlDatabase::addDatabase("QODBC");
qDebug() << "DRIVERS :" << QSqlDatabase::drivers();
QString fullDBName = "DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=" + dBName;
db.setDatabaseName(fullDBName);
if (!db.open()) {
logMessage( QString::fromLocal8Bit("Ошибка подключения к базе данных: ")
+ db.lastError().text());
return false;
}
return true;
}
Answer the question
In order to leave comments, you need to log in
Install mdbtools, convert data to normal format (SQL) and stop this perversion.
If you want it to be cross-platform, forget about MDB and master SQLite.
Everything works fine on Windows, but it doesn't want to on Ubuntu.
How to set up ODBC for this, and is this the problem?
ODBC is a Windows offspring ... another crutch - why wouldn't it work?
Linux doesn't have ODBC support by default, it's foreign to it.
You need to install ODBC ... and then everything is the same: "E2 - E4 ...".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question