cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jacderida
Level 2

Using SQL SMO from InstallScript

Hi,

I have a custom action in my install (basic MSI project) that currently uses SQL DMO to get a list of SQL Server database instances that are running on the machine that the installation is running from.

I create the DMO object via a call to CreateObject in InstallScript, but for some reason, the call to ListInstalledInstances on the SQLServer object fails on Windows Server 2008.

So, we thought about upgrading to SMO to see if this would solve the problem. However, the functionality that I need seems to only be available via a static method in SMO (http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.smoapplication.enumavailablesqlservers.aspx).

Is it possible to call static methods after creating a COM object via CreateObject? I tried sqlServer.EnumAvailableSqlServers(), but that failed.

If anybody could offer any help on this it would be appreciated.
Labels (1)
0 Kudos
(1) Reply
TimStVCS
Level 7

I am not sure I understand what it is you are trying to do. That said, there are multiple built-in dialog boxes that you can use to get various information regarding SQL Server. Take a look at SQLBrowse in the InstallShield Help Library and you will see some of them.

Tim
0 Kudos