Try "qry.lastError().text()" @ line 39 in lieu of "db.lastError().text()"