Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = QSqlDatabase::addDatabase("QSQLITE");
- db.setDatabaseName(sqliteDbName);
- db.open();
- if(!db.open())
- {
- qDebug() << "db error: " << db.lastError().text();
- qFatal( "Failed to connect." );
- }
- 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)");
- if (!qry.exec())
- {
- qDebug() << "qry error: " << qry.lastError().text();
- qFatal("Failed to connect to db.");
- }
- else
- {
- qDebug() << "table created";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement