September 22, 2003

Home-grown Data Mining in SQL Server

s a database programmer, when you don’t know where the tables and columns you need to do your job are, you’re dead in the water. You can browse through Enterprise Manager looking for tables whose columns are likely candidates, but columns often are tersely named in a less-than-intuitive manner, making

GetComPlusAppRoles – Retrieving a COM+ Application’s roles

‘ Get an array with the name of an application’s roles’ Note: requires a reference to the COM+ Admin Type Library” Example:’ Dim roles() As String = GetComPlusAppRoles(“System Application”, “”)’ Dim role As String’ For Each role In roles’ Console.WriteLine(role)’ NextFunction GetComPlusAppRoles(ByVal applicationName As String, _ ByVal serverName As String)

GetComPlusAppRoleMembers – Retrieving a COM+ Application role’s members

‘ Get an array with the members of an application’s role’ Note: requires a reference to the COM+ Admin Type Library” Example:’ Dim members() As String = GetComPlusAppRoleMembers(“System Application”,’ “Administrator”, “”)’ Dim member As String’ For Each member In members’ Console.WriteLine(member)’ NextFunction GetComPlusAppRoleMembers(ByVal applicationName As String, _ ByVal roleName As

ShutDownComPlusApplication – Shutting-down a COM+ application

‘ Shut-down the COM+ application with the input name’ Note: requires a reference to the COM+ Admin Type Library” Example: ShutDownComPlusApplication(“MyComPlusApp”, “”)Sub ShutDownComPlusApplication(ByVal applicationName As String, _ ByVal serverName As String) Dim catalog As New COMAdmin.COMAdminCatalog catalog.Connect(serverName) ‘ shutdown the application catalog.ShutdownApplication(applicationName)End Sub

ExportComPlusApplication – Exporting a COM+ application to a MSI installer file

‘ Export the COM+ application with the input name to a MSI installer file’ Note: requires a reference to the COM+ Admin Type Library” Example: ExportComPlusApplication(“MyComPlusApp”, “C:MyComPlusApp.msi”, “”)Sub ExportComPlusApplication(ByVal applicationName As String, _ ByVal msiFile As String, ByVal serverName As String) Dim catalog As New COMAdmin.COMAdminCatalog catalog.Connect(serverName) ‘ export the

StartComPlusApplication – Starting a COM+ application

‘ Start the COM+ application with the input name’ Note: requires a reference to the COM+ Admin Type Library” Example: StartComPlusApplication(“MyComPlusApp”, “”)Sub StartComPlusApplication(ByVal applicationName As String, _ ByVal serverName As String) Dim catalog As New COMAdmin.COMAdminCatalog catalog.Connect(serverName) ‘ start the application catalog.StartApplication(applicationName)End Sub