Click to See Complete Forum and Search --> : Activating Client with MTS
lenin
May 22nd, 2000, 10:07 PM
hello,
I have a fairly simple question. how do I implement the client portion of a VB project after I have registered the component with MTS?
Basically I have created a simple dll to connect, and provide a couple of methods for returning records from our database server. However any texts i have don't explicitly tell me how to install a client 9 to communicate with the server compenet), and reference the class methods on the middle tier.
I am presuming package and deployment wizard is wrong.
any help appreciated.
Lenin.
André
May 23rd, 2000, 02:33 PM
Hi,
Let me see if I understand you correctly. You have created a DLL and installed it in MTS on your Server. Now you want to use it from a client app, correct?
Well, if you want to call it from ASP vbscript then just use this:
Set obj=Server.CreateObject("DLLName.ClassName")
Set rs=Server.CreateObject("ADODB.Recordset")
Now if your DLL returns a recordset then
Set rs=obj.Method (parameter1,...,parameterN)
then work with the recordset as you usually do.
If you are going to call it from a VB form, well you'll need a vbr file, that is a DCOM extension to tell the client machine where your DLL is.
You can also export the package from MTS and run the exe in your client machine, then you can add the reference to your VB project.
André
lenin
May 23rd, 2000, 02:43 PM
No, sorry I meant a VB client.
André
May 23rd, 2000, 02:58 PM
Ok then, no problem either:
Firs go to your server and get to your MTS package installed, right click on your package an choose export, then follow the instruction on where to export the file.
Once done MTS creates an exe, this exe must then be transferred to your client machine. On your client machine run the exe, it should take less than a second to install.
Ok, now your client machine has registered the remote dll wich means that you can now add a reference to it from your VB project.
To work with it:
Dim obj as DllName.ClassName
Set obj=New DllName.ClassName
Dim rs as ADODB.Recordset
Set rs=New ADODB.Recordset
Set rs=obj.Method(Parameter1,...,ParameterN)
Work with it as you do normally with Recordsets,
Good luck,
André
lenin
May 23rd, 2000, 03:18 PM
excellent Andre. I think this is exactly what I am looking for.
Again. thanks
Tony.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.