Answer the question
In order to leave comments, you need to log in
How to download QODBC driver?
QSqlDatabase: QODBC driver not loaded
QSqlDatabase: available drivers:
Very strange things happen, then it loads the QODBC driver, then it doesn’t load it, it’s not QSQLITE and nothing else
version of qt Qt 5.14.2
build cmake
you create such a project:
cmake_minimum_required(VERSION 3.5)
project(untitled LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5
COMPONENTS
Core
Sql
REQUIRED)
add_executable(untitled
main.cpp
)
target_link_libraries(untitled Qt5::Core Qt5::Sql)
#include <QCoreApplication>
#include <QSql>
#include <QSqlDatabase>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QSqlDatabase bd = QSqlDatabase::addDatabase("QODBC");
return a.exec();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question