Thanks for the replies; I was finally able to do a basic proof of concept.
*** Sorry if I posted multiple times accidentally :) ***

Here is what I have learned (comments are welcome), using W2K Pro, Access
97 and SQL Server 2000...

(a) A private dll assembly implementing an interface in common with a
remote object can be registered as a "COM" object, callable from Access 97.
(b) Apparently, both the interface and the private assembly must both be
registered (can use regasm) and have type libraries created (can use tlbexp
or regasm /tlb).
(c) Both the type libs and the dll's must be copied to the Access
executable directory because the global cache is not used.  Although this
does not provide much security, for an intranet it may suffice.  Also, no
mucking around with strong names is required.
(d) The private assembly implements the common interface explicitly and
simply calls the proxy:

public class Client_Security_MSAccess3 : ISecurity_NSN
\\Interface also implemented by the remote object.
{

    private ISecurity_NSN oSec;

    public Client_Security_MSAccess3()
    {
     try
     {
       TcpChannel chan = new TcpChannel(0);
       //ChannelServices.UnregisterChannel(chan);
       ChannelServices.RegisterChannel(chan);
        }
        catch (Exception e)
        {  ... }
        oSec = (ISecurity_NSN)Activator.GetObject(typeof
(ISecurity_NSN), "tcp://166.107.97.248:8090/Security");
...
    }

        //A sample method.  Notice that the interface is
explicitly "called."  Also, I simply call the proxy in the method body:
  int ISecurity_NSN.LongDesc2CodeID( string strLongDesc )
 {
     return oSec.LongDesc2CodeID( strLongDesc );
 }
 ...
}

(e) It appears that a constructor is necessary.
(f) For some reason, I did not have to explicitly implement the properties
found in the common interface.  Implicit implementation seems to suffice.

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London
http://www.develop.com/courses/gdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to