Qt database operation error not positioned on a valid record

Disclaimer: This article original, without permission is forbidden. QQ group: QT & C / C ++ lovers 271251545 https://blog.csdn.net/xuancailinggan/article/details/78172234

Today's article on the word:

not positioned on a valid record

This translation is very simple, it is not positioned on a valid data record.

The reason is simple, because the operation when performing sql, data pointer is to stay ahead of the data, therefore, we need to move the pointer to:

QSqlQuery sql;
    sql.exec("select name,password from adminuser");
    sql.next();

The following is next () function.

Guess you like

Origin blog.csdn.net/xuancailinggan/article/details/78172234