Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create an object for remote server?

636 views
Skip to first unread message

Andrew HUANG

unread,
Nov 30, 2007, 4:31:03 PM11/30/07
to
In my code:

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

Anthony Jones

unread,
Dec 1, 2007, 4:23:44 PM12/1/07
to
"Andrew HUANG" <Andre...@discussions.microsoft.com> wrote in message
news:2330DE6F-4BC1-4FA9...@microsoft.com...

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


Andrew HUANG

unread,
Dec 3, 2007, 6:11:00 PM12/3/07
to
Thanks, Anthony.

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

Anthony Jones

unread,
Dec 4, 2007, 3:28:11 AM12/4/07
to
"Andrew HUANG" <Andre...@discussions.microsoft.com> wrote in message
news:A0D4A8C4-8F74-42C9...@microsoft.com...

> Thanks, Anthony.
>
> 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?
>


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.

Andrew HUANG

unread,
Dec 4, 2007, 11:59:01 AM12/4/07
to
Hi, Anthony,

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

0 new messages