Set objCatlog = CreateObject("COMAdmin.COMAdminCatalog")
objCatlog.Connect(strServerName)
Set objApplications = objCatlog.GetCollection("Applications")
objApplication.Populate
For each objApplication in objApplications
Set objComponents = objApplications.GetCollection("Components",
objApplication.Key)
objComponents.Populate
For each objComponentItem in objComponents
Set objComponent = CreateObject(objComponentItem.Value("ProgID"))
'it doesn't work
Next
Next
My question: how to create an object for remote server?
objComponentItem.Value("ProgID") is from server, but cannot create a object
for the server, why?
Thanks,
-Andrew
You can create a remote com object using the second parameter of the
createobject function:-
Dim obj : Set obj = CreateObject(strProgID, strServerName)
However the user context under which the script runs needs to have been
granted access to activate and use the class on the remote machine.
A type library containing the definitions for the interfaces used by the
remote object need to be installed on the local machine. Without these the
local machine will have no way to know how to marshall procedure calls to
the remote server.
--
Anthony Jones - MVP ASP/ASP.NET
I just tried it. but it doesn't work.
Error:800A01AD, ActiveX Component can't create object
Even thorugh for application, not for library.
Would you have any idea?
Regards,
-Andrew
When you say "I tried it" did you mean?
a) Put the server name as the second parameter?
Or
b) Ensured a type library for the component is installed on the local
computer; ensured the current local user has the priviledges to activate and
access the component on the remote server; as well as place the server name
as the second parameter of the createobject call?
If b then check the event logs on both machines to see if there is anything
useful there.
a) Put the server name as the second parameter?
Yes: Set obj = CreateObject(strProgID, strServerName)
b)
Only test for a type application (not library) for the component. and
ensured the current local user has the priviledges to activate and access the
component on the remote server.
Regards,
-Andrew