Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Wrong field type of QSqlField
Forum Updated to NodeBB v4.3 + New Features

Wrong field type of QSqlField

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 169 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • beeckscheB Offline
    beeckscheB Offline
    beecksche
    wrote on last edited by
    #1

    Hi,
    the QSqlField class returns an integer (QVariant::Int) as field type instead of a boolean (QVariant::bool) for a sql server database used with ODBC driver, like mentioned in the docs.

    SQL Server Management Studio:
    ssms.JPG

    QtCreator:
    qt.JPG

    Qt 5.15.2, ODBC Driver 17 for SQL Server

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      The docs do not say that the data type of the QSqlRecord should be QMetaType::Bool - it just tells you that you should use boolean values for it.
      But yes, it's a little bit strange, esp. since a bound value of type QMetaType::Bool is send as SQL_BIT. Will take a look on it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved