Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. db = QSqlDatabase::addDatabase("QSQLITE");
  2. db.setDatabaseName(sqliteDbName);
  3. db.open();
  4. if(!db.open())
  5. {
  6. qDebug() << "db error: " << db.lastError().text();
  7. qFatal( "Failed to connect." );
  8. }
  9.  
  10. qry.prepare("CREATE TABLE IF NOT EXISTS addons (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE ,naam VARCHAR UNIQUE , update VARCHAR, created VARCHAR, download VARCHAR, supports VARCHAR)");
  11.  
  12. if (!qry.exec())
  13. {
  14. qDebug() << "qry error: " << qry.lastError().text();
  15. qFatal("Failed to connect to db.");
  16. }
  17. else
  18. {
  19. qDebug() << "table created";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement