I am trying to connect to SQL Server 2008 with qt ... I am doing this:
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC"); db.setHostName("ITPL_PC1\\SQLEXPRESS"); db.setDatabaseName("Test"); db.setUserName("sa"); db.setPassword("insforia"); bool ok = db.open();
I also added qtsql4 and qtsqld4 libs, but now the problem is that I get an error that the database could not be opened ... I am very new to qt. I do not know how to do that? So, any help on how to connect to the database, what else needs to be added or where am I mistaken?
source share