Hi there,
I'm using QODBC with my application and I would like to pass driver's
path instead of a
name while adding a new database to QSqlDatabase. Actually, I have this code:
|
Source code
|
1
2
3
4
5
|
QString connectionString = "DRIVER={SQL SERVER};SERVER=192.168.0.1,1433;DATABASE=Test;";
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName(connectionString);
db.setUserName("username");
db.setUserPassword("password");
|
where
SQL SERVER is the name of the driver that I use (and is listed in e.g. Windows' ODBC Administrator). I'd like to pass the path to the driver, because I am not sure if users that will use the app will have such driver properly installed in "ODBC Data Sources". I'd rather not rely on settings from OS.
Does anyone know how to achieve this?
Cheers!