QSQL SQLite problem
-
I've a problem with SQLite, when consulting the DB for a User and Pass it just doesn't work), I can ask if the user exist, but not if the password it's correct.
@
QSqlQuery sql;
QString strSql = "SELECT Usuario,Clave,Administrador FROM UsuariosSistema WHERE Usuario=:usuario AND Clave=:clave";
sql.prepare(strSql);
sql.bindValue(":usuario", usuario);
sql.bindValue(":clave", claveHash.toHex());
@this code works in MySQL but not in SQLite, and in SQLite if I do this:
@QSqlQuery sql;
QString strSql = "SELECT Usuario,Clave,Administrador FROM UsuariosSistema WHERE Usuario=:usuario;
sql.prepare(strSql);
sql.bindValue(":usuario", usuario);@it works, but I need to get the password too, am I missing something? the DB has the same content..
-
-
I see, sorry SQLite can't accept Hex data types.
"SQLite datatypes":http://www.sqlite.org/datatype3.html
You should try to change them into QString to store. -
[quote author="JessyNay" date="1318822832"][quote author="ron9776" date="1318822074"]1
qDebug()<<sql.lastError().text();[/quote]I don't get it, What were you trying to say? that's the first answer I got
[/quote]
It was a spam account. I removed the post and deleted the user.