modify you code like this
bool ok
= build.
exec( QString("create table %1 (" "id INTEGER PRIMARY KEY AUTOINCREMENT,"
"name VARCHAR(90)"
"author VARCHAR(50)"
"copy INTEGER"
"press VARCHAR(120))").arg( name) )
if( !ok )
QMessageBox::information(this,
"Fail", build.
lastError().
text());
QSqlQuery build;
bool ok = build.exec( QString("create table %1 ("
"id INTEGER PRIMARY KEY AUTOINCREMENT,"
"name VARCHAR(90)"
"author VARCHAR(50)"
"copy INTEGER"
"press VARCHAR(120))").arg( name) )
if( !ok )
QMessageBox::information(this, "Fail", build.lastError().text());
To copy to clipboard, switch view to plain text mode
and show us a result.
Bookmarks