On the other hand, the next code:
QSqlQuery data
(*pointer_my_database
->GetDBPtr
());
data.
prepare(QString("SELECT id FROM users WHERE iaccesslevel=:iaccesslevel AND sname = :sname"));
data.bindValue(":sname", name);
data.bindValue(":iaccesslevel", CSQLUsers::AL_PUPIL);
data.exec();
bool test1 = data.first();
bool test2 = data.isValid();
bool test3 = data.isSelect();
QString name = 'Alex';
QSqlQuery data(*pointer_my_database->GetDBPtr());
data.prepare(QString("SELECT id FROM users WHERE iaccesslevel=:iaccesslevel AND sname = :sname"));
data.bindValue(":sname", name);
data.bindValue(":iaccesslevel", CSQLUsers::AL_PUPIL);
data.exec();
bool test1 = data.first();
bool test2 = data.isValid();
bool test3 = data.isSelect();
To copy to clipboard, switch view to plain text mode
gives me false, false and true again :S
Bookmarks