Microsoft KB Archive/247752: Difference between revisions

From BetaArchive Wiki
(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 &quot;My Computer&quot; =
= <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 &quot;'''My Computer'''&quot;.
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 &quot;COM + 1.0 Admin Type Library&quot;.</li>
<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 &quot;Win2KServer&quot; 'Replace with any Windows 2000 computer name  
     oCat.Connect "Win2KServer" 'Replace with any Windows 2000 computer name  
     Set oCLocalComputerCol = oCat.GetCollection(&quot;LocalComputer&quot;)
     Set oCLocalComputerCol = oCat.GetCollection("LocalComputer")
     oCLocalComputerCol.Populate
     oCLocalComputerCol.Populate
     Set oCLocalComputerItem = oCLocalComputerCol.Item(0)
     Set oCLocalComputerItem = oCLocalComputerCol.Item(0)
     MsgBox oCLocalComputerItem.Value(&quot;Name&quot;)
     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 &quot;My Computer&quot; in the message box. Please remember to connect to Windows 2000 computers while testing.</li></ol>
<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

  1. Create a new Standard EXE project in Visual Basic.
  2. Add a reference to "COM + 1.0 Admin Type Library".
  3. Place a CommandButton control on Form1.
  4. 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
                        
  5. 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