for the past two weeks i have been searching the internet and qtcentre, qtfourm etc and found conflicting information about Qt database access and mac.

do the database drivers in Qt 4.5 binary pagkage work "out of the box" on mac, i have found the windows package does, but i can not get them to work on mac (leopard).

this code works on windows "out of the box" .

it does not work on mac.
Qt Code:
  1. {
  2. QSqlDatabase Db = QSqlDatabase::addDatabase("QODBC", "Calendar");
  3.  
  4. Db.setHostName("localhost");
  5. Db.setDatabaseName("mySql");
  6. Db.setUserName("root");
  7.  
  8. bool goodQuery;
  9. bool validrec;
  10. int x;
  11. x=1;
  12.  
  13. if(Db.open()) // database is open
  14. {
  15. QSqlQuery query(Db);
  16. query.exec("SELECT * from artist" );
  17. goodQuery=query.isActive(); // this returns true
  18. query.first(); // returns "Database Not Loaded"
  19. validrec=query.isValid(); // this returns false
  20. x=query.size(); // this returns -1
  21.  
  22. while(query.next()){
  23. new QListWidgetItem(query.value(0).toString(), ui->listWidget); //this never executes
  24. }
  25. }
  26. Db.close();
  27. }
To copy to clipboard, switch view to plain text mode 

on mac
I can get column names but i can not get field data, at the query.first() line i get "database not loaded".

i am trying to access by odbc, i have confirmed the odbc drivers are installed correctley on mac by using other programs to query the database.

drivers are installed
On mac /Developer/Applications/Qt/plugins/sqldrivers
libqsqlite.dylib
libqsqlodbc.dylib
libqsqlpsql.dylib

I am at a loss, can someone point me in right direction. thanks in advance.