<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Read float type field error by QODBC(SQL Server 2017)  after upgrade windows patch &quot;November 8, 2022-KB5020686 or KB5020695&quot;]]></title><description><![CDATA[<p dir="auto">After I upgraded window patch (win10 November 8, 2022-KB5020686, win11 KB5020695),  if table has float type field,  QODBC will raise an error and the column result is QVariant(Invalid).</p>
<p dir="auto">Below example,  query.value(1) will got an QVariant(Invalid) value.  But it returned a QVariant(Double) value if I run it on win7(Because win7 does not has such upgrade package).</p>
<pre><code>
#include &lt;QCoreApplication&gt;
#include &lt;QSqlDatabase&gt;
#include &lt;QSqlQuery&gt;
#include &lt;QDebug&gt;
#include &lt;QSqlError&gt;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");

    QString dsn = QString("DRIVER=%1;SERVER=%2;PORT=%3;DATABASE=%4;UID=%5;PWD=%6")
            .arg("{SQL Server}")
            .arg("127.0.0.1")
            .arg(1433)
            .arg("TestDB")
            .arg("sa")
            .arg("sa");

    db.setHostName("127.0.0.1");
    db.setDatabaseName(dsn);
    db.setUserName("sa");
    db.setPassword("sa");

    if(!db.open()) {
        qDebug()&lt;&lt;db.lastError().text();
    } else {
        qDebug()&lt;&lt;"database open success!";
        QSqlQuery query(db);
        query.exec("select id, my_float from my_table");
        while(query.next()) {
            qDebug()&lt;&lt;query.value(0) &lt;&lt; query.value(1);
        }
        return -1;
    }
}



</code></pre>
]]></description><link>https://forum.qt.io/topic/141090/read-float-type-field-error-by-qodbc-sql-server-2017-after-upgrade-windows-patch-november-8-2022-kb5020686-or-kb5020695</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 10:56:47 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/141090.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Nov 2022 13:53:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Read float type field error by QODBC(SQL Server 2017)  after upgrade windows patch &quot;November 8, 2022-KB5020686 or KB5020695&quot; on Fri, 10 Feb 2023 19:02:58 GMT]]></title><description><![CDATA[<p dir="auto">Even the topic is old I think the problem was fixed with KB5022282 on January, 10th 2023.</p>
]]></description><link>https://forum.qt.io/post/747162</link><guid isPermaLink="true">https://forum.qt.io/post/747162</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Fri, 10 Feb 2023 19:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Read float type field error by QODBC(SQL Server 2017)  after upgrade windows patch &quot;November 8, 2022-KB5020686 or KB5020695&quot; on Mon, 28 Nov 2022 14:32:26 GMT]]></title><description><![CDATA[<p dir="auto">See <a href="https://bugreports.qt.io/browse/QTBUG-108307" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-108307</a> and blame MS :)<br />
Downgrade to an older ODBC driver (or use the recent 17.x one)</p>
]]></description><link>https://forum.qt.io/post/738008</link><guid isPermaLink="true">https://forum.qt.io/post/738008</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 28 Nov 2022 14:32:26 GMT</pubDate></item></channel></rss>