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. Reading SQL - qGetStringData Error
Forum Updated to NodeBB v4.3 + New Features

Reading SQL - qGetStringData Error

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 552 Views
  • 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.
  • D Offline
    D Offline
    Daniele78
    wrote on last edited by
    #1

    Hi,
    I need an help.
    I have Qt on Win10, assuming that until yesterday everything worked correctly and with sql I am a beginner, today instead from QtCreator I read this message in the "Application Output" window: "qGetStringData: Error while fetching data (" [Microsoft] [ODBC SQL Server Driver] Unknown code(??token??) received from SQL Server. ")"
    and indeed some data are correctly read while others are not (float and varchar).

    The parameters used in QSqlDataBase are:
    dataBase = QSqlDatabase :: addDatabase ("QODBC");
    dataBase.setDatabaseName ("DRIVER = {SQL SERVER}; SERVER = SRVMST02 \ OM_DB; DATABASE = dbMIRROR");

    Instead If I use these, everything works fine:
    dataBase = QSqlDatabase :: addDatabase ("QODBC");
    dataBase.setDatabaseName (DRIVER = {ODBC Driver 17 for SQL Server}; SERVER = SRVMST02 \ OM_DB; DATABASE = dbMIRROR);

    I really like to undestand why and possibly give me a solution. The purpose is to get back into operation using the initial parameters, that is:
    dataBase = QSqlDatabase :: addDatabase ("QODBC");
    dataBase.setDatabaseName ("DRIVER = {SQL SERVER}; SERVER = SRVMST02 \ OM_DB; DATABASE = dbMIRROR");

    Thanks in advance!!

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

      https://bugreports.qt.io/browse/QTBUG-108307

      Looks like a ms odbc driver problem.

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

      JonBJ 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        https://bugreports.qt.io/browse/QTBUG-108307

        Looks like a ms odbc driver problem.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        Amazing spot :)

        @Daniele78
        I looked at that and the KB5019961 it stems from is dated November 8, 2022, so that should it explain why it has just happened to you!

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

          Imo it's a bug in the recent mssql odbc sql driver 18.1.2, you can download an older version here: https://github.com/MicrosoftDocs/sql-docs/blob/live/docs/connect/odbc/windows/release-notes-odbc-sql-server-windows.md

          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
          0

          • Login

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