[Qt-interest] 答复: QTableView with summary footer

Samuel Gaist samuel.gaist at edeltech.ch
Wed Sep 7 14:30:54 CEST 2011


Please do not highjack threads, your question is unrelated to the subject.

As for your problem the answer lies within:
http://doc.qt.nokia.com/4.7/qsqlquery.html#exec

Hope it helps
Samuel

On 7 sept. 2011, at 11:26, pengliang(彭亮) wrote:

> Hi All
> 	Please see the snippets and output.
> Why QSqlQuery execute is true, but query.isValid is false?
> How can I get the error information?
> 
> 
> 
> 
> -------------------- snippets
>    QString str;
>    str = "SELECT * FROM kblive.dbo.View_PI_在站工单查询";
>    QSqlQuery query;
>    qDebug() << "exec: " << query.exec(str);
> 
> qDebug() << "query.isValid: " << query.isValid();
> qDebug() << "query.lastError: " << query.lastError().isValid();
> 
> 
> ---------------- output
> exec:  true 
> query.isValid:  false 
> query.lastError:  false
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list