With prepared statements, QSqlQuery::prepare() will fail on SQL syntax errors, which QSqlQuery::exec() will not catch (it will fail for not having the right number of parameters). Currently, almost none of the prepare() calls are checked for return value.