
chriso1.5524949223981633E12 asked a question.
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.
Tim