Quote Originally Posted by C167 View Post
a SELECT-query seems not to like the QSqlQuery::exec () method.
If you pass a string to QSqlQuery constructor, it will execute it immediately. It should be:
Qt Code:
  1. QSqlQuery query;
  2. query.prepare("UPDATE pictures SET data=? WHERE rowid=1;");
  3. query.addBindValue(fileData);
  4. query.exec();
To copy to clipboard, switch view to plain text mode 

And the select should be:
Qt Code:
  1. QSqlQuery query( "SELECT data FROM pictures WHERE rowid=1;" );
  2. query.next(); // <- positions the query on the first row
  3. QSqlRecord record = query.record();
To copy to clipboard, switch view to plain text mode