Solved

CreateObject remote

Posted on 2001-08-08
8
588 Views
Last Modified: 2012-06-27
Hi, how come I cant use Server.CreateObject("some.object", "somemachine") like this? I can call CreateObject (without going through the server object) instead, and this works. Why is this?

Thanks in advance!
0
Comment
Question by:pede
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 2

Expert Comment

by:DirkVe
ID: 6364260
Server.CreateObject invokes objects that are installed of the machine where you execute it = webserver.

So in order to use those objects, you need to install the right applications (in case 3rd party or MS components like ADO) or register the right components/dll's (in case custom components)

0
 
LVL 33

Expert Comment

by:hongjun
ID: 6364265
This is because you are trying to create an object on another machine (NOT YOURS) so CreateObject without Server will be correct.

hongjun
0
 
LVL 5

Accepted Solution

by:
Droby10 earned 50 total points
ID: 6366450
the createobject function in a script-host context does not support remote initialization...to get around this you can create a simple dll with the extended functionality, register the remote component library or interface locally, and register the remote component in component services on the remote machine.

'====================================
' demo.asp
'

<%

dim rDisp
dim rObj

  set rDisp = createobject ( "MyLocalLib.remoteDispatch" )
  set rObj = rDisp.createobjectEx( "MyRemoteLib.remoteObject", "MyRemoteServer" )
  if ( typename ( rObj ) = "Err" ) then
    response.write err.description
  else
    ' do some stuff
  end if
  set rObj = nothing
  set rDisp = nothing

%>

' end of demo.asp


'====================================
' MyLocalLib.remoteDispatch.cls
'====================================

public function createobjectEx ( byval className$, byval machineName$ ) as object
dim rObj as object

  on error resume next
  err.clear
  set rObj = createobject ( className$, machineName$ )
  if ( err.number <> 0 )
    set createobjectEx = err
    err.clear
  else
    set createobject = rObj
  end if
  set rObj = nothing
end function

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:pede
ID: 6367828
Any reason not to just use CreateObject? (instead of Server.CreateObject). Why make CreateObjectEx?

This question is for you, Droby10, since you are the only one who actually read my question, hehe :O)
0
 
LVL 1

Author Comment

by:pede
ID: 6367844
UNACCEPTABLE AND OFFENSIVE COMMENT MADE BY PEDE WAS REMOVED BY MOONDANCER (MODERATOR) TODAY AND SAVED TO FILE, COPIED TO ADMINISTRATION.  Pede is not in compliance with this site's Guidelines.

Moondancer Community Support Moderator @ Experts Exchange
0
 
LVL 5

Expert Comment

by:Droby10
ID: 6369618
you would need to provide the remote initialization functionality...createobject does not take 2 parameters in a scripting or within the iserverobject interface...

the createobjectex does this.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6772774
Greetings, pede:

I see that you logged in as recently as 01/29/02, but have not finalized or updated your open questions.  You have asked 59 of them and only closed/awarded 47 of them.  Of those you've closed, 10 of them were stuck against userid-1 rather than actually experts receiving them due to the JSP-500 errors of that time frame, and I have corrected all of them for you today so that the intended experts finally get these points and have validated your pointsas well.  I will post this information in all your open questions so that you can quickly and easily navigate through them and update them.  If you've been helped, please award the expert who helped you to close them.  If more is needed, please add comments with details.  In the event more than one expert helped you, let us know the expert name and points you wish to give them so that we can help you with Points Splits.  

This information is helpful in terms of this site's Guidelines, Member Agreement and the Question / Answer process.  Also, any time you need our help, just post a zero point question in the Community Support topic area with your request along with the question link.  Here are the links to Community Support and the site related information links:

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp
http://www.experts-exchange.com/jsp/infoMemberAgreement.jsp
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp
http://www.experts-exchange.com/jsp/infoWhatsNew.jsp

These are all your OPEN QUESTIONS which require your attention and in which this update will be posted:  Please note, some are so old, they date back to the year 2000 in which the question sort order is not in the normal comment date order, but rather in userid order, so special attention needs to be paid to them in determining the first/best response given.

http://devx.experts-exchange.com/jsp/qShow.jsp?qid=11642038
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20035846
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20073357
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20085988
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20089161
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20113284
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20114689 (Open for ZERO points)
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20123640
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20143252
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20158158
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20165237
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=20165903
http://devx.experts-exchange.com/jsp/qShow.jsp?qid=10206933


Some of your questions are open for low or zero points, help given and still not awarded.  When you check the links I provided above, you'll find that the recommended value for EASY questions is 50 points, and the maximum for difficult questions is 300 points.  You can increase the value of any of them yourself without Moderator help to draw more attention, if that is needed.

Your response in updating and closing all your open questions is not only appreciated, but necessary.  I have sent this information to Administration.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6780389
Unresponsive to follow up requests, Email sent by Administrator, and pede logged in 2/5 but chose not to respond to any of them.

This has been finalized today.

Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filktering Alphabetically 8 46
window close link 7 66
Two decimal 5 44
Split on ASP 8 53
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question