TL;DR
I'd like to prevent BIML from wrapping my ODBC driver in double quotes when it creates my dtsx package.
More info
I have a very simple BIML file, shown below after the BIML code header, which connects to Composite Information Server (CIS). I don't think the datasource is important, but I thought I'd include in case it's pertinent to the question/problem.
The CIS ODBC driver is installed with a driver name of Cisco Information Server 7.0
.
As below, I'm entering the driver name correctly, but when BIML generates the dtsx package, it wraps quotes round the name, so, for a connection like this:
<OdbcConnection Name="CIS" ConnectionString="Driver={Cisco Information Server 7.0};Server=xxxxxxxxxx;Port=xxxxxxxxxx;Domain=xxxxxxxxxx;dataSource=xxxxxxxxxx;database=src;User=xxxxxxxxxx;Password=xxxxxxxxxx;Encrypt=yes;" />
...I end up with a connection string, like this:
Driver={"{Cisco Information Server 7.0}}"};server=xxxxxxxxxx;port=xxxxxxxxxx;domain=xxxxxxxxxx;datasource=xxxxxxxxxx;database=xxxxxxxxxx;user=xxxxxxxxxx;encrypt=yes
If I remove the curly braces and use a connection string like this:
<OdbcConnection Name="CIS" ConnectionString="Driver=Cisco Information Server 7.0;Server=xxxxxxxxxx;Port=xxxxxxxxxx;Domain=xxxxxxxxxx;dataSource=xxxxxxxxxx;database=src;User=xxxxxxxxxx;Password=xxxxxxxxxx;Encrypt=yes;" />
...I still end up with a connection string like this:
Driver={"Cisco Information Server 7.0"};server=xxxxxxxxxx;port=xxxxxxxxxx;domain=xxxxxxxxxx;datasource=xxxxxxxxxx;database=xxxxxxxxxx;user=xxxxxxxxxx;encrypt=yes
Edit Just for clarity (as it was missing from the original post) the extra quotes added by the BIML compiler mean the driver is unrecognised and executing the generated package throws this error:
Execute SQL Task: Failed to acquire connection "CIS". Connection may not be configured correctly or you may not have the right permissions on this connection.
I have a working solution (more of a workaround) by creating a duplicate registry entry for the driver in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
, with the non-alphanumeric chars removed, then referencing this in BIML.
However, I'd like to know if there's a way to stop the BIML compiler wrapping quotes round my ODBC driver.
Thanks in advance for any suggestions!
BIML code
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<OdbcConnection Name="CIS" ConnectionString="Driver={Cisco Information Server 7.0};Server=xxxxxxxxxx;Port=xxxxxxxxxx;Domain=xxxxxxxxxx;dataSource=xxxxxxxxxx;database=src;User=xxxxxxxxxx;Password=xxxxxxxxxx;Encrypt=yes;" />
</Connections>
<Packages>
<Package Name="TestPackage" ConstraintMode="Parallel" ProtectionLevel="EncryptSensitiveWithUserKey" DelayValidation="true">
<Variables>
<Variable Name="TestResult" DataType="Int32">0</Variable>
</Variables>
<Tasks>
<ExecuteSQL Name="ConnectionTest" ConnectionName="CIS" ResultSet="SingleRow">
<DirectInput>SELECT COUNT(*) FROM SCHEMA.TABLE</DirectInput>
<Results>
<Result Name="1" VariableName="User.TestResult" />
<!-- ODBC requires a 1-based param number -->
</Results>
</ExecuteSQL>
</Tasks>
</Package>
</Packages>
</Biml>