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 validation
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
‎Feb 24, 2010
12:42 PM
SQL connection validation
I am trying to validate the connection to an existing SQL Server. The thing that seems to be the big issue is that I only want it to populate the results in a property instead of displaying an error message. I am using Basic MSI. I've tried using ISSQLServerValidate, but it always displays an error. Does anyone know of a way to just test the connection without the message?
Thanks,
Dave
Thanks,
Dave
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2010
01:53 PM
you can do it in an Installscript CA if you don't mind making an ADODB connection.. here's a snippet from one of my custom actions:
set Connection = CreateObject("ADODB.Connection");
set Command = CreateObject("ADODB.Command");
Connection.Provider = "SQLOLEDB.1";
Connection.Properties("Data Source").Value = DataSource;
Connection.Properties("Initial Catalog").Value = "";
if (AuthenticationType = "0") then
Connection.Properties("integrated security").Value = "SSPI";
else
Connection.Properties("user id").Value = UserName;
Connection.Properties("password").Value = Password;
endif;
// Open Connection
UTIL_WriteToLogFileUI(hMSI, "Creating database connection. If this fails you most likely have an authentication issue.", userInterface);
Connection.Open;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2010
02:50 PM
Try setting 1 to the IS_SQLSERVER_CA_SILENT Windows Installer property in order to suppress the connection error dialog. An connection error description is set to the IS_SQLSERVER_STATUS_ERROR property.
Hope that helps.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2010
02:52 PM
hidenori wrote:
Try setting 1 to the IS_SQLSERVER_CA_SILENT Windows Installer property in order to suppress the connection error dialog. An connection error description is set to the IS_SQLSERVER_STATUS_ERROR property.
Hope that helps.
oh that's pretty sweet. I end up doing much more than just testing the connection (I am having to verify that specific databases of specific versions exist.) Good to know about that property though.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2010
03:47 PM
SWEEEET! Thank you very much!
What is the flag to enable the dialog message? I tried 0, but no luck.
What is the flag to enable the dialog message? I tried 0, but no luck.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2010
03:48 PM
Try setting an empty string.