QSqlQuery does not return a record set?
-
You get the sql record out of a query with... QSqlQuery::record(). If you want to store it into your own structure then you have to convert it by yourself.
-
@jdent what did you try and what do you want to do?
-
@Christian-Ehrlicher I want to do a FindAll() method that returns all rows of a table in a std::vector -- such a simple thing seems impossible in Qt...
-
@jdent Then pass all records into a vector and search in them - what's the problem?
-
@Christian-Ehrlicher How do I pass all records into a vector??
I want to do this:
std::vector<PasswordRecord> vec; QSqlQuery q; if(! q.exec(SQL::FindAllPassword)) { showError(q.lastError()); return vec; } while(q.next()) { PasswordRecord rec(q); vec.push_back(rec); } return vec;
How do i program PasswordRecord ?? There should be a way to get the result set of the QSqlQuery!! As in .NET!!
-
You get the sql record out of a query with... QSqlQuery::record(). If you want to store it into your own structure then you have to convert it by yourself.
-
@Christian-Ehrlicher Thanks!!
-