[Qt-interest] Qt4, ODBC, Informix IDS11

First Last a78o at mail.ru
Fri Sep 25 15:03:33 CEST 2009


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



More information about the Qt-interest-old mailing list