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 Connection Properties
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
‎Apr 21, 2008
10:53 AM
SQL Connection Properties
I am working with an InstallScript project.
My project uses OnSQLServerInitialize to get SQL Server connection information.
I need to get the IS_SQLSERVER_SERVER and IS_SQLSERVER_DATABASE properties after the OnSQLServerInitialize is finished so I can build and encrypt the connection string and then write to a web.config file.
My question is, how do I read the IS_SQLSERVER_SERVER and IS_SQLSERVER_DATABASE properties from InstallScript. I tried MSIGetProperty but I guess I can't use it from an InstallScript only project.
Any help would be greatly appreciated.
My project uses OnSQLServerInitialize to get SQL Server connection information.
I need to get the IS_SQLSERVER_SERVER and IS_SQLSERVER_DATABASE properties after the OnSQLServerInitialize is finished so I can build and encrypt the connection string and then write to a web.config file.
My question is, how do I read the IS_SQLSERVER_SERVER and IS_SQLSERVER_DATABASE properties from InstallScript. I tried MSIGetProperty but I guess I can't use it from an InstallScript only project.
Any help would be greatly appreciated.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2008
11:16 AM
Windows Installer properites are not available for InstallScript projects. In that project type, you need to call the SQLRTGetConnectionInfo() function to get connection information. Please refer to the default implementation of the OnSQLServerInitialize() event in order to find out how to use the function.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2008
11:29 AM
Thanks for your reply.
I had tried the SQLRTGetConnectionInfo but couldn't get it to work. Here is what I had:
nResult = OnSQLServerInitialize( nResult );
if( nResult = BACK ) goto Dlg_SdFeatureTree;
SQLRTGetConnectionInfo(szDBConnection, szDBServer, szDBName, szDBUser, szDBPassword);
All the properties are empty after the function call. I also tried to get it to work by calling SQLRTInitialize2 first, but on reading the docs it said OnSQLServerInitialize calls that anyway.
I had tried the SQLRTGetConnectionInfo but couldn't get it to work. Here is what I had:
nResult = OnSQLServerInitialize( nResult );
if( nResult = BACK ) goto Dlg_SdFeatureTree;
SQLRTGetConnectionInfo(szDBConnection, szDBServer, szDBName, szDBUser, szDBPassword);
All the properties are empty after the function call. I also tried to get it to work by calling SQLRTInitialize2 first, but on reading the docs it said OnSQLServerInitialize calls that anyway.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2008
11:31 AM
Did you set a correct connection name to szDBConnection?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 21, 2008
11:42 AM
No I wasn't. That was the problem. Thanks for your help 🙂