SQL Error Msg on Qt 5.5

After running the following code I keep getting the following error message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified QODBC3: Unable to connect. Can somebody please help me to figure out what is going wrong? Thank you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  #include <QCoreApplication>
#include <QtSql>
#include <QtDebug>
#include <QSqlDatabase>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QString servername = "LOCALHOST\\SQLEXPRESS";
    QString dbname = "test";

    QSqlDatabase db = QSqlDatabase::addDatabase ("QODBC");

    db.setConnectOptions ();

    QString dsn = QString("DRIVER=(SQL Native Client);SERVER=%1;DATABASE=%2;Trusted_Connection=Yes;").arg(servername).arg (dbname);

    db.setDatabaseName (dsn);

    if(db.open ())
    {
        qDebug() << "Opened";
        db.close ();
    }
    else
    {
		qDebug()  << "Error = " << db.lastError ().text ();
    }
Topic archived. No new replies allowed.