So, there is:
Oracle 11g Express Edition x64
Qt 5.11.0 + MinGW x32 + MSVC2015 x64 (Even studio 2015 is there)
Win7 x64

Now to the problem, it is necessary to connect the project to the database via ODBC
When building via MinGW and configuring ODBC via administration, we have an error:
enter image description here

When configuring ODBC through odbcad32.exe from SysWOW64, the error is: enter image description here
Well, if you build a project through MSVC, then the error is as follows: enter image description here
How to connect the project to the database? Which way to dig? Which of the shoals to fix in the first place?

QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "XE"); db.setHostName("localhost"); //- db.setPort(1521); //- db.setDatabaseName("XE"); //+ db.setUserName("system"); //+ db.setPassword("2608"); //+ if (!db.open()) { QMessageBox::information(this, "HEOK",db.lastError().text()); } else QMessageBox::information(this, "OK", "KRUTO!"); 
  • The procedure for configuring ODBC and the connection code to the database in the studio. Through MSVC is not compiled because the QT kit for MinGW is compiled, you need the kit for MSVC - tequillaz
  • The @tequillaz code was added to the question, the MSVC package costs, it seems like it doesn’t even swear at anything - zipazar
  • Driver customized 32 or 64 bit? - tequillaz
  • As for MSVC, they themselves wrote that there was an error when building. qmake is set to mingw, and the build tool is studio tequillaz
  • one
    Mingw collects 32-bit program, others he can not. Judging by the description of the error from snapshot No. 1, the supplied and configured driver is for a 64-bit architecture. Judging by the description of the error from snapshot No. 2 and help from here support.microsoft.com/ru-ru/help/942976 , odbcad32.exe from SysWOW64 configures a 32-bit driver that you don’t have, or it lacks some components, which is what is written in the picture. As for the MSVC compiler, it needs a qt bundle compiled using MSVC; a kit compiled for mingw will not work with MSVC. - tequillaz

1 answer 1

I solved the problem: I collect the project through MinGW x32, the DBMS also did x32.
About the driver: deleted the old one through the manager who is in SysWOW64 , otherwise he swears at the absence of some installers, after which he added through the manager from the administration, there were no problems.