Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 22nd, 2003, 10:50 AM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Location: Toronto, ON, Canada.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to start COM+ services?

Does anybody know how to start/stop COM+ services from within VB?
Thanks,


-Ned
__________________
-Ned
  #2 (permalink)  
Old August 26th, 2003, 04:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Add a ref in your project to the "COM+ 1.x Admin Type Library", then you can use the COMAdminCatalog object to do this.
Code:
Dim oCatalog As COMAdmin.COMAdminCatalog
Set oCatalog = CreateObject("COMAdmin.COMAdminCatalog")
oCatalog.ShutdownApplication "PackageName" ' to shut it down
oCatalog.StartApplication "PackageName" ' to start it
If you want to do it for all applications, you can use one of the collections:
Code:
Dim oPackages As Object
Set oPackages = oCatalog.GetCollection("Applications") 
oPackages.Populate

Dim oPackage As COMAdmin.COMAdminCatalogObject
For Each oPackage In oPackages
  oCatalog.ShutdownApplication oPackage.Value("Name")
Next
hth
Phil


Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't know where to start......... Geneine Bugg BOOK: Beginning ASP 3.0 0 December 20th, 2006 12:00 PM
how to stop and start windows services from linux. ramakula@gmail.com Linux 1 December 12th, 2006 07:53 AM
Where do I start? Michele_Haywood Access 1 November 2nd, 2006 09:39 AM
Hor to start COM+ services? Ned Pro VB Databases 1 August 3rd, 2004 06:58 AM
Where to start? jerush Dreamweaver (all versions) 1 August 12th, 2003 07:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.