qt在连接数据库时提示:QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
------解决方案--------------------------------------------------------
你会不会是声明QSqlQuery query时没有与数据库连接名关联啊
QSqlQuery query
改为
QSqlQuery query(dbTemp)
试试
------解决方案--------------------------------------------------------
dbTemp是什么
------解决方案--------------------------------------------------------
你的QSqldatabase 对象