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: SQL Login connection strings
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 11, 2008
10:56 AM
SQL Login connection strings
I am installing a web application that is backed by a SQL database. I have an MSI Project with InstallScript. These forums have shown me how to properly customize the SQL Login dialog, duplicate it (I have multiple DSNs) and write out properties to an XML File. Thanks to Christopher Painter, klcounte and rsinclair for getting me through the XML file stuff!
http://community.macrovision.com/showthread.php?t=168242&highlight=editing+web.config and http://community.macrovision.com/showthread.php?t=143739 have great info on the topics.
I am now trying to figure out the cleanest way to alter my connection strings based on the Windows vs. SQL authentication radio buttons.
I created a custom action, CreateMainDSN, that is attached to the SQL Login Next button. This action sets a SQL_LOGIN_DSN property based on values from the SQLLogin dialog. I then write out SQL_LOGIN_DSN to a web.config file using the XML File Changes. Everything works fine when I assume a specific type of authentication, but I can't figure out an easy way to handle this:
if (Windows authentication)
SQL_LOGIN_DSN = "String 1"
else
SQL_LOGIN_DSN = "String 2"
I can use InstallScript or VBScript, but assume there is a better way to do this. Does anybody have advice on how to properly handle conditional logic when setting a property via custom actions?
http://community.macrovision.com/showthread.php?t=168242&highlight=editing+web.config and http://community.macrovision.com/showthread.php?t=143739 have great info on the topics.
I am now trying to figure out the cleanest way to alter my connection strings based on the Windows vs. SQL authentication radio buttons.
I created a custom action, CreateMainDSN, that is attached to the SQL Login Next button. This action sets a SQL_LOGIN_DSN property based on values from the SQLLogin dialog. I then write out SQL_LOGIN_DSN to a web.config file using the XML File Changes. Everything works fine when I assume a specific type of authentication, but I can't figure out an easy way to handle this:
if (Windows authentication)
SQL_LOGIN_DSN = "String 1"
else
SQL_LOGIN_DSN = "String 2"
I can use InstallScript or VBScript, but assume there is a better way to do this. Does anybody have advice on how to properly handle conditional logic when setting a property via custom actions?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 19, 2008
06:08 PM
Use 2 CA's with mutually exclusive conditional expressions. If string 1 evaluates to true, set the DNS property to one formated value otherwise set it to a different formated value.