D
D
DVoropaev2017-10-10 23:59:12
linux
DVoropaev, 2017-10-10 23:59:12

Qt, why can't I connect to MS SQL?

MSSQL is lifted on an ubunt.
QT is also on Ubuntu.
through sqlcmd I am connected easy.

dataBase = QSqlDatabase::addDatabase("QODBC3");
    dataBase.setDatabaseName("DRIVER={SQL Server};SERVER=localhost;DATABASE=Praktikc;Trusted_Connection=yes;");
    dataBase.setUserName("SA");
    dataBase.setPassword("tipapassword");
       if (dataBase.open()){
        qDebug()<<"OPEN";qDebug()<<dataBase.lastError();
        qDebug()<<dataBase.lastError();
       }
    else{
        QMessageBox msbox;
        msbox.setText("Ошибка подлючения к Базе Данных");
        msbox.exec();
    }

in debug here is this info:

QSqlDatabase: QODBC3 driver not loaded
QSqlDatabase: available drivers: QSQLITE

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Katerina, 2017-10-11
Bumagina @eitelleren

Installing MS SQL ODBC Driver under Linux and building plugin for Qt 5.9: tutorial .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question