QSqlDatabase db = QSqlDatabase::addDatabase("QODBC","connection");
QString path = "AttachDbFilename=C:\\Program Files\\Microsoft SQL Server\\MSSQL11.SQLPROTUPIN\\MSSQL\\DATA\\hospital.mdf";
db.setDatabaseName("DRIVER={SQL Server}; Server=.\\SQLPROTUPIN;" + path + ";Database=hospital; Trusted_Connection=Yes;");
bool ok = db.open();