Hello Johannes,
1. Thanks for the in-depth answer! That's very helpful to get more insights. But unfortunately, that does not answer my question. I already have the connection itself working (my SQL queries work fine) with the Connection Mode set to ODBC Data Source. My problem now is that the connection test actually reflects the same settings used for the connection (therefore using the same data source called XRDB). In the Sql Test Connection settings I can only change the Connection String. So is it possible to adapt the Connection String such that it reflects the same behavior as my actual connection (with the Connection Mode set to ODBC Data Source)?
Unfortunately, we do not have support for this. You can, however, pass your ODBC Attributes to the Connection String:
- connection string.png (49.53 KiB) Viewed 9258 times
Just add all your properties from the ODBC Data source on this string.
2. Okay, so my actual problem here is that the ODBC Data Source is only persisted after pressing "Install" and it is not usable beforehand. But I need to test the connection and do some SQL queries using that Data Source before pressing "Install" So my setup is like this:
You can try to set the "Persistent" option for your properties used on the
Attributes section of your
Data Source. Just go to the
Properties page and enable this option for the desired properties:
- persistent property.png (55.36 KiB) Viewed 9258 times
3. Many thanks, I wasn't aware that I can use a property here too. As a suggestion, it would be great to have the possibility to use the property selector here too or at least highlight the [DRIVER_PROP] text in brown as is done usually.
So I switched to using the property [ODBC_DRIVER_PROP] here but this results in an error message after pressing the 'Install' button. I have my [ODBC_DRIVER_PROP] assigned to "ODBC Driver 17 for SQL Server" manually which should be exactly the same as when selecting a Driver Name via the provided dropdown. What can be the issue here? The error message I get:
I'm sorry for this. It seems that this field does not support properties. In order to achieve your scenario, you can try the below solution:
1. Add two data sources. Add the name of the desired driver, for one Data Source you can add the "ODBC Driver 17 for SQL Server" driver name, and for the other you can add "ODBC Driver 13 for SQL Server" in the driver name field.
- data sources.png (43.53 KiB) Viewed 9258 times
2. From the
SQL Databases page add two
Predefined Connections. In the
ODBC Data Source field select one of the two Data Sources added at step (1). For the other predefined connection, add the second data source.
Now, you can condition these predefined connection with your search result on the
Condition field.
- predefined.png (50.38 KiB) Viewed 9258 times
Attached you can find my sample project. Hope this helps!
Best regards,
Liviu