PDA

View Full Version : what is going on a QSqlQuery?



mismael85
26th June 2008, 12:14
hello every body,
i have a problem with QSqlQuery
i built a query easy and i went to the first record by using

query->next()
until now every thing works fine later in the program i used

query->seek(id)
the query went to the record i want because i investigate that by trying

query->at()
i found it on the roght record but when i try to get the text from the record no thing return

query->value(0).toString()

but, but
when i used

query->last()
before

query->seek(id)
every thing works fine
i want to know why?
and thank you

mcosta
26th June 2008, 12:40
Some database doesn't know the query size QSqlDriver::hasFeature()

In this case before to use QSqlQuery::seek() or QSqlQuery::size() you have to go to the last record.

cyberboy
26th June 2008, 14:35
Try query.value(0).toString()