Hi everybody,

QT: 4.1.1
Compiler: MINGW 4.1
OS: WINXP

I am trying to connect to my local sql server, and i was not able:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
  2. db.setHostName("localhost");
  3. db.setDatabaseName("DRIVER={SQL Server};SERVER=localhost;DATABASE=inventar;UID=rapha;PWD=raphaelf");
  4. db.setUserName("rapha");
  5. db.setPassword("raphaelf");
  6. if(!db.open())
  7. {
  8. QMessageBox::information(this, "Application name",
  9. "not connected");
  10. return false;
  11.  
  12. }
  13. else
  14. QMessageBox::information(this, "Application name",
  15. "connected");
  16. return true;
To copy to clipboard, switch view to plain text mode 
Postgres connection works perfect:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
  2. db.setHostName("localhost");
  3. db.setDatabaseName("DRIVER={PostgreSQL};SERVER=localhost;DATABASE=inventar;UID=rapha;PWD=raphaelf");
  4. db.setUserName("rapha");
  5. db.setPassword("raphaelf");
  6. if(!db.open())
  7. {
  8. QMessageBox::information(this, "Application name",
  9. "not connected");
  10. return false;
  11.  
  12. }
  13. else
  14. QMessageBox::information(this, "Application name",
  15. "connected");
  16. return true;
To copy to clipboard, switch view to plain text mode 

What need i to connect to my sql server?