Answer the question
In order to leave comments, you need to log in
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();
}
QSqlDatabase: QODBC3 driver not loaded
QSqlDatabase: available drivers: QSQLITE
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