Tried this but does not work
QString cmd = "CREATE TABLE example(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), age INT)";
QSqlQuery query;
query.exec(cmd);
qDebug() << query.lastError();
reports: QSqlError(-1, """", """")
Tried this but does not work
QString cmd = "CREATE TABLE example(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), age INT)";
QSqlQuery query;
query.exec(cmd);
qDebug() << query.lastError();
reports: QSqlError(-1, """", """")
Last edited by Harvey West; 14th December 2006 at 19:04. Reason: Fingers
What do you mean by "does not work"? Do you connect to the database? Does this statement work, if you execute it from the SQL console?
No worries - Typo - works now.
Was on the right path which is nice to know. Cheers.
Bookmarks