PDA

Click to See Complete Forum and Search --> : how to change it?


needhelp
Feb 25th, 2003, 06:32 AM
hai all

i don't want to fix the server name while creating a setup for the client application which uses DCOM.

i want to give it runtime while running the client application. Based on the given name, my client application should get the reference from that server.

is there any way?

FATBOYPEE
Feb 25th, 2003, 09:15 AM
There is a way to do this but it's not that simple.

Using the following Code will allow you to late-bind a reference to an object from a selected Server at Runtime.



Dim svrObj as Object

Set svrObject = CreateObject("ObjectName.ClassName","ServerName")



The downside to this is that the Object you reference MUST be part of COM+ package and referenced as such on each of the Servers otherwise the Late-Bind will not find the object.

Peeman.

ByNature
Feb 25th, 2003, 10:00 AM
Originally posted by needhelp
hai all

i don't want to fix the server name while creating a setup for the client application which uses DCOM.

i want to give it runtime while running the client application. Based on the given name, my client application should get the reference from that server.

is there any way?

Wouldn't you have to execute clireg32.exe on .vbr and .tlb files everytime you switch server name?

needhelp
Feb 25th, 2003, 10:11 PM
hai fatboypee and bynature,

thank you for your help. but the problem is i am using the developed code and so i cannot change the code right now.

so i need a custom setup which asks for servername if it was changed. user will enter the new servername, then automatically that client should connect to the new server.

is it possible to write that sort of program in VB?

looking for your valuable help.....

FATBOYPEE
Feb 26th, 2003, 04:58 AM
I'm not sure that can be done as the reference will have been compiled into the EXE before deployment and an implicit link made between DCOM Server & App.

Peeman