<code>In Qt6, the SQL server was connected and the database was successfully opened. However, when using the setTable method of QsqlTableModel, the error "QODBDriver:: record: Unable to
</code>
<code>In Qt6, the SQL server was connected and the database was successfully opened. However, when using the setTable method of QsqlTableModel, the error "QODBDriver:: record: Unable to
</code>
In Qt6, the SQL server was connected and the database was successfully opened. However, when using the setTable method of QsqlTableModel, the error "QODBDriver:: record: Unable to
allocate handle” appeared.
code:
<code>{
tabModel = new QSqlTableModel(this, DB);
tabModel->setTable(QString("Book"));
if (! tabModel->select()) {
QMessageBox:: critical (this, "Error message", "Opening database table error, Error message:n"+ tabModel->lastError().text());
qDebug() << tabModel->lastError().text();
return;
}
</code>
<code>{
tabModel = new QSqlTableModel(this, DB);
tabModel->setTable(QString("Book"));
if (! tabModel->select()) {
QMessageBox:: critical (this, "Error message", "Opening database table error, Error message:n"+ tabModel->lastError().text());
qDebug() << tabModel->lastError().text();
return;
}
</code>
{
tabModel = new QSqlTableModel(this, DB);
tabModel->setTable(QString("Book"));
if (! tabModel->select()) {
QMessageBox:: critical (this, "Error message", "Opening database table error, Error message:n"+ tabModel->lastError().text());
qDebug() << tabModel->lastError().text();
return;
}
I want to know why this problem occurred.QODBDriver::record: Unable to allocate handle
New contributor
restrain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.