Reading SQL - qGetStringData Error
-
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!!
-
https://bugreports.qt.io/browse/QTBUG-108307
Looks like a ms odbc driver problem.
-
https://bugreports.qt.io/browse/QTBUG-108307
Looks like a ms odbc driver problem.
@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! -
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