On the other hand, the next code:

Qt Code:
  1. QString name = 'Alex';
  2. QSqlQuery data(*pointer_my_database->GetDBPtr());
  3. data.prepare(QString("SELECT id FROM users WHERE iaccesslevel=:iaccesslevel AND sname = :sname"));
  4.  
  5. data.bindValue(":sname", name);
  6. data.bindValue(":iaccesslevel", CSQLUsers::AL_PUPIL);
  7. data.exec();
  8.  
  9. bool test1 = data.first();
  10. bool test2 = data.isValid();
  11. bool test3 = data.isSelect();
To copy to clipboard, switch view to plain text mode 

gives me false, false and true again :S