QSqlDatabase TMB;void MainWindow::on_pushButton_clicked(){ TMB = QSqlDatabase::addDatabase("QMYSQL"); TMB.setDatabaseName("tmse"); if (!TMB.open()) { QMessageBox::critical(this, "", qApp->tr("Cannot open database.\n" "Unable to establish a database connection.\n" "Perhaps Qt was built without database support.\n\n" "Click Cancel to exit."), QMessageBox::Cancel); } }
QSqlDatabase::database("TMB",true).close();
0 ntdll!RtlPcToFileHeader C:\WINDOWS\system32\ntdll.dll 0 0x7c926fd9 1 msvcrt!free C:\WINDOWS\system32\msvcrt.dll 0 0x77c1c2de 2 ?? 0 0x08e90000 3 ?? 0 0x00000000