QSqlDatabase *m_pDB_pg = QSqlDatabase::addDatabase("QODBC3"); m_pDB_pg->setDatabaseName("SIRIUS"); if(!m_pDB_pg->open()) { QMessageBox::warning(this, "Warning", "Co'nt connect to PG database!", "OK"); }