Sorry if this is a repost but I couldn't find another post on the subject. I have a need to use Qt and a MS Access database. I have the Qt ODBC plugin built. Now I am trying to access the database. I've done this using Qt and MySQL but I must be doing something wrong here I'm trying to keep it real simple. I wasn't sure what to put for the database name in setDatabaseName(). Do I put the name of the MS Access file?? I'm also not aware of any username/passwords. What am I missing? TIA.

This is the output Im getting:
ODBC:pen() : error opening connection : " [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified QODBC3: Unable to connect"

Qt Code:
  1. int main(int argc, char ** argv)
  2. {
  3. QApplication app(argc, argv);
  4.  
  5. QSqlDatabase mgDb = QSqlDatabase::addDatabase("QODBC");
  6.  
  7. qDebug() << "Library Paths " << QApplication::libraryPaths() << endl;
  8.  
  9. // Open connection.
  10. mgDb.setHostName("localhost");
  11. mgDb.setDatabaseName("MissileLogDB_USMTF.mda");
  12. if(mgDb.open() == false)
  13. {
  14. qDebug() << "ODBC::open() : error opening connection : "
  15. << mgDb.lastError().text() << "\n";
  16. return false;
  17. }
  18. return app.exec();
  19.  
  20. } // main
To copy to clipboard, switch view to plain text mode