nivs

Untitled

Oct 10th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. QSqlDatabase *db = new QSqlDatabase();
  2. db->addDatabase("QMYSQL");
  3. db->setHostName("localhost");
  4. db->setDatabaseName("testDB");
  5. db->setUserName("testDB");
  6. db->setPassword("testDB");
  7. bool ok = db->open();
  8. if (ok) {
  9. qDebug() << "!!!";
  10. }
  11. else {qDebug() << "drivers: "<< QSqlDatabase::drivers();
  12. qDebug() << db->lastError();
  13. }
  14. qDebug() << qApp->libraryPaths();
Advertisement
Add Comment
Please, Sign In to add comment