Hi, I have the code:Code:
{ Q_ASSERT(strPicPath.size()>0); // assertion test // use query /* QSqlQuery useQuery("USE merchandize;"); qDebug() << useQuery.lastError(); // debug */ // query string; queryString=queryString.arg(strPicPath); qDebug() << "queryString:" << queryString; // debug //Q_ASSERT(query.value(iMerchandizeFieldNAME).toString().size()>0); // assertion test qDebug() << query.lastError(); // debug: shows error qDebug() << query.value(iMerchandizeFieldNAME).toString(); // debug return(query.value(iMerchandizeFieldNAME).toString()); // returns merchandize name }
and after qDebug() << query.lastError() I get:
The connection to database is ok, I've double checked. What is wrong, please help!