#define GUI
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");db.setHostName("localhost");db.setDatabaseName("dbname");db.setUserName("user");db.setPassword("password");bool ok = db.open(); if (ok)...
QCoreApplication app(argc, argv);return app.exec();