This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Change Connection String in config file
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Jul 11, 2008
08:47 AM
Change Connection String in config file
Hi
I have looked at all the posts about this topic but none are really what I am after. I have 3 config files that all contain the connection strings (used for different programs) and I want to be able to change the string depending on the database server they select.
I have tried this (post 2) method but when it runs I get an error that makes it terminate the installation.
What I really want is a method to change to the correct connection string in the XML File Changes section. The methods I have tried for this only return the server name - connect to localhost, the connection string would be set to "(localhost)/sqlexpress" - where it needs to be ".\sqlexpress".
Is there a variable, that stores the actual connection string used?
Thanks,
Rich
I have looked at all the posts about this topic but none are really what I am after. I have 3 config files that all contain the connection strings (used for different programs) and I want to be able to change the string depending on the database server they select.
I have tried this (post 2) method but when it runs I get an error that makes it terminate the installation.
What I really want is a method to change to the correct connection string in the XML File Changes section. The methods I have tried for this only return the server name - connect to localhost, the connection string would be set to "(localhost)/sqlexpress" - where it needs to be ".\sqlexpress".
Is there a variable, that stores the actual connection string used?
Thanks,
Rich
(4) Replies
‎Jul 15, 2008
06:39 AM
But how do you get that property to be the connection string?
Say for example, the user chooses to connect to the localhost\sqlexpress, the connection string should be .\sqlexpress but if the user wants to connect to a different server, say dbserver and the conenction string was set to be dbconnect the connection string should be set accordingly.
Presumably InstallShield knows this connection string to allow it to run SQL scripts, but how do I get this value to be used by me, doesn't matter how to write it to the config files, we are changing that, but to get the value is the important bit. There is a built in variable for the server name so there must be one for the conenction string.
Thanks,
Rich
Say for example, the user chooses to connect to the localhost\sqlexpress, the connection string should be .\sqlexpress but if the user wants to connect to a different server, say dbserver and the conenction string was set to be dbconnect the connection string should be set accordingly.
Presumably InstallShield knows this connection string to allow it to run SQL scripts, but how do I get this value to be used by me, doesn't matter how to write it to the config files, we are changing that, but to get the value is the important bit. There is a built in variable for the server name so there must be one for the conenction string.
Thanks,
Rich
‎Jul 15, 2008
07:21 AM
In a Basic MSI the properties that get set are defined on the Advanced tab for that connection. Installshield probably takes those properties and creates there own connection string within their ISSQL custom actions.