Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSqlError and lastError with no fault? i.e.(-1, "", "")



  • I haven't found alot of information on the following return from lastError(): QSqlError(-1, "", "") .

    Far as I can tell it means a successful query. Just curious if this could mean anything bad.



  • For me, it looks like lastError() is not active meaning when you check lastError().isActive(), it should return false because your query is successful. I would read it like that.



  • Thank you. You are write I am still a bit of a noob, I should be using clearer code when setting up debugging along with further research of the method.



  • I usually only use lastError() if the query exec itself returned false. :-)

    Note that suggestions for improvements in the documentation are welcome in Jira.


Log in to reply