///////////////////////////////////////////////////////////////// // Datei : connection.h // // version : 0.41 // // ///////////////////////////////////////////////////////////////// #include #define DRIVER "QMYSQL3" #define DATABASE "UePraK" #define USER "UePraK_all" #define PASSWORD "rudolph" #define HOST "localhost" bool create_connection() { QSqlDatabase* db = QSqlDatabase::addDatabase(DRIVER); db->setDatabaseName( DATABASE ); db->setUserName( USER ); db->setPassword( PASSWORD ); db->setHostName( HOST ); if( !db->open() ){ QMessageBox::information( 0, "Unable to open database", db->lastError().databaseText() + "\nPlease read the README file in the sqltable directory for more information."); return FALSE; } else return TRUE; };