Microsoft KB Archive/247752: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 12: | Line 12: | ||
<div id="TitleRow"> | <div id="TitleRow"> | ||
= <span id="KB247752"></span>BUG: COM+ 1.0 AdminCatalog Always Returns | = <span id="KB247752"></span>BUG: COM+ 1.0 AdminCatalog Always Returns "My Computer" = | ||
Line 44: | Line 44: | ||
== SYMPTOMS == | == SYMPTOMS == | ||
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 | 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'''". | ||
</div> | </div> | ||
Line 69: | Line 69: | ||
<ol> | <ol> | ||
<li>Create a new Standard EXE project in Visual Basic.</li> | <li>Create a new Standard EXE project in Visual Basic.</li> | ||
<li>Add a reference to | <li>Add a reference to "COM + 1.0 Admin Type Library".</li> | ||
<li>Place a '''CommandButton''' control on Form1.</li> | <li>Place a '''CommandButton''' control on Form1.</li> | ||
<li><p>Paste the following code in the Command1_Click event:</p> | <li><p>Paste the following code in the Command1_Click event:</p> | ||
Line 76: | Line 76: | ||
Dim oCLocalComputerItem As COMAdminCatalogObject | Dim oCLocalComputerItem As COMAdminCatalogObject | ||
oCat.Connect | oCat.Connect "Win2KServer" 'Replace with any Windows 2000 computer name | ||
Set oCLocalComputerCol = oCat.GetCollection( | Set oCLocalComputerCol = oCat.GetCollection("LocalComputer") | ||
oCLocalComputerCol.Populate | oCLocalComputerCol.Populate | ||
Set oCLocalComputerItem = oCLocalComputerCol.Item(0) | Set oCLocalComputerItem = oCLocalComputerCol.Item(0) | ||
MsgBox oCLocalComputerItem.Value( | MsgBox oCLocalComputerItem.Value("Name") | ||
Set oCLocalComputerItem = Nothing | Set oCLocalComputerItem = Nothing | ||
Line 86: | Line 86: | ||
Set oCat = Nothing | Set oCat = Nothing | ||
</pre></li> | </pre></li> | ||
<li>Run the project. No matter what computer you connect to, you will always get | <li>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.</li></ol> | ||
Latest revision as of 13:50, 21 July 2020
Article ID: 247752
Article Last Modified on 7/31/2001
APPLIES TO
- Microsoft COM+ 1.0
This article was previously published under Q247752
SYMPTOMS
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".
RESOLUTION
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.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
MORE INFORMATION
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.
REFERENCES
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