[Qt-interest] Qt 4.5.2 handles numeric(10.6) as String

Sylvain Pointeau sylvain.pointeau at gmail.com
Sat Oct 31 08:37:13 CET 2009


Hi all,

I connect to a SQL server 2005 database by the line:

    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    db.setDatabaseName("DRIVER={SQL
Server};server=XXXX;uid=XX;pwd=YYYYY;database=ZZZZZZ;");

when I retrieve some rows, especially the numeric(15,6) are seen as string
on the Qt side:

QVariant v = query.value(i);
v.type() always 10 (QVariant::String)

How can I know about the real type of this field?
I would like to see them as "double", am I wrong?

Many thanks in advance for your help,

Best regards,
Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091031/9cca8270/attachment.html 


More information about the Qt-interest-old mailing list