
Originally Posted by
ChrisW67
You shouldn't have to have anything other than:
QT += sql
QT += sql
To copy to clipboard, switch view to plain text mode
in your project.pro file to get all the correct paths to build and run the application in the Qt SDK environment.
Thanks, but... I tried so many things that I forgot to mention how it started in the beginning. If I do as you say, yes, everything compiles OK, but then it does not work. For instance:
QStringList drivers = QSqlDatabase::drivers ();
To copy to clipboard, switch view to plain text mode
only reports: "QMYSQL3" and "QMYSQL", no "QSQLITE" and when I try:
m_db.setDatabaseName(strFileName);
m_bValid = (m_db.open() && m_db.isValid());
m_db = QSqlDatabase::addDatabase("QSQLITE");
m_db.setDatabaseName(strFileName);
m_bValid = (m_db.open() && m_db.isValid());
To copy to clipboard, switch view to plain text mode
m_bValid is always false and no DB operation succeeds (note: the above code works under Windows...).
The SQLite library is there, twice (see prev. post)! How can I convince Qt to notice it?
Thanks,
M.
Bookmarks