Is mydb open? Does QSqlQuery::prepare() return true? What about QSqlQuery::exec()? Have you looked at QSqlQuery::lastError()? Have you tried the SQL without the trailing semicolon?