Microsoft KB Archive/247752
Article ID: 247752
Article Last Modified on 7/31/2001
- Microsoft COM+ 1.0
This article was previously published under Q247752
When you use the LocalComputer collection of the COM+ Administration objects, all attributes will have the values corresponding to the computer specified in the Connect method of the COMAdminCatalog object, except for the Name property. This will always return the string "My Computer".
Currently there is no workaround. If you need the computer name, you must rely on the string you pass to the .Connect method of the COMAdminCatalog object rather than using the value returned by the Name of the LocalComputer collection.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Steps to Reproduce Behavior
- Create a new Standard EXE project in Visual Basic.
- Add a reference to "COM + 1.0 Admin Type Library".
- Place a CommandButton control on Form1.
Paste the following code in the Command1_Click event:
Dim oCat As New COMAdminCatalog Dim oCLocalComputerCol As COMAdminCatalogCollection Dim oCLocalComputerItem As COMAdminCatalogObject oCat.Connect "Win2KServer" 'Replace with any Windows 2000 computer name Set oCLocalComputerCol = oCat.GetCollection("LocalComputer") oCLocalComputerCol.Populate Set oCLocalComputerItem = oCLocalComputerCol.Item(0) MsgBox oCLocalComputerItem.Value("Name") Set oCLocalComputerItem = Nothing Set oCLocalComputerCol = Nothing Set oCat = Nothing
- Run the project. No matter what computer you connect to, you will always get "My Computer" in the message box. Please remember to connect to Windows 2000 computers while testing.
For more information about the LocalComputer collection, see the following MSDN Web site:
Additional query words: My Computer MTS COM+ Administration LocalComputer same COM + 1.0 Admin
Keywords: kbbug kbnofix kbsysadmin kbcompluscatalog KB247752