if(QSqlDatabase::contains("qt_sql_default_connection"))db = QSqlDatabase::database("qt_sql_default_connection");elsedb = QSqlDatabase::addDatabase("QSQLITE");db.setDatabaseName("qq.db");if(!db.open()){QMessageBox::warning(NULL, "Open DB", tr("Open DB error:%1").arg(db.lastError().text()));}QSqlQuery query;query.prepare("create table user(id varchar(15) not null primary key,passwd varchar(15) not null,nickname varchar(15) null)");if( !query.exec() ){QMessageBox::warning(NULL, "Create Table", tr("Create Table error:%1").arg(query.lastError().text()));}提示:Create Table error:No query Unable to fetch row
1 回答
海绵宝宝撒
TA贡献1809条经验 获得超8个赞
setInterval(函数名,1000); t: Timer = new Timer(1000, 5); t.addEventListener(TimerEvent.TIMER,函数名); t.addEventListener(TimerEvent.TIMER_COMPLETE, 函数名); t.start();
添加回答
举报
0/150
提交
取消