[Qt-interest] Qt4, ODBC, Informix IDS11

Bill King bill.king at nokia.com
Mon Sep 28 01:24:46 CEST 2009


That's all fine. Looks like the informix driver doesn't return a size of
the dataset (that's informix's fault, and not qt odbc's fault). Also,
isValid will not be true until you do your first next() call, until it
hits the end of the dataset. As to why query.next is not working, I have
no idea, maybe query.lastError() will tell you.


On 09/25/2009 11:03 PM, ext First Last wrote:
> Dear all,
>
> I'm trying to run following code:
> <code>
>     QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3"); // also tried to use QODBC
>     db.setDatabaseName("odbcxxx");
>     qDebug() << "db.open: " << db.open();
>
>     QSqlQuery query;
>     qDebug() << "query.exec: " << query.exec("select * from tablexxxxx");
>
>     qDebug() << "query.size: " << query.size();
>     qDebug() << "query.isActive: " << query.isActive();
>     qDebug() << "query.isValid: " << query.isValid();
>
>     while (query.next()) {
>         QString field = query.value(0).toString();
>         qDebug() << field;
>     }
> </code>
>
> and get the following output:
> <output>
> db.open:  true 
> query.exec:  true 
> query.size:  -1 
> query.isActive:  true 
> query.isValid:  false 
> </output>
>
> Control Panel -> Administrative Tools -> Data Sources (ODBC), Data source defined as following:
> Name: odbcxxx
> Driver: IBM INFORMIX ODBC DRIVER ver. 2.90.00.12497 (also tried to use IBM INFORMIX 3.82 32 BIT driver ver. 3.82.00.11811)
> Server, Host, Protocol, etc... is set to correct values because I use another utility that use the same data source and works correctly.
>
> Table tablexxxxx exists and has about 5 rows.
>
> DB: IBM Informix Dynamic Server Version 11.10.UC1, RHEL5
> Qt: 4.5.1, Windows XP SP2
>
> Could somebody advice what is the problem?
> Thank in advance
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   


-- 
Bill King, Software Engineer
Qt Development Frameworks, Nokia Pty Ltd
Brisbane Office




More information about the Qt-interest-old mailing list