http://support.microsoft.com/kb/317535 

 

  _____  

Ian Thomas
Victoria Park, Western Australia

  _____  

From: [email protected] [mailto:[email protected]]
On Behalf Of Maddin, Peter
Sent: Monday, 8 March 2010 10:49 AM
To: [email protected]
Subject: Calling a class library C# method from ms access

 

I need to call a C# method from MS Access 2003.

I need to pass in a string and return a string.

 

I have spent some trying to do this in Delphi but am now sure I need to use
COM so I might as well use C#.

 

I have wasted a couple of days almost getting it working only to find that
it was too flaky with Access crashing.

 

Does anyone have a simple code example they would be willing to share?

 

The goal is to pass in a string (which will be a password) and return a hash
of that string using MD5 or something similar.

Generating the hash is no problem its just writing the class and method so
Access will be able to call it, setting up the MS Access declaration and
calling the method passing in a string and returning a string.

 

I believe one needs to make the assembly 'Com-Visible".

Also the Access declaration needs to specify the TLB and not the dll.

One needs to register the dll (? And tlb) using regasm.

 

Is there anything else required?

 

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : [email protected]
The contents of this e-mail transmission outside of the WAGHS network are
intended solely for the named recipient's), may be confidential, and may be
privileged or otherwise protected from disclosure in the public interest.
The use, reproduction, disclosure or distribution of the contents of this
e-mail transmission by any person other than the named recipient(s) is
prohibited. If you are not a named recipient please notify the sender
immediately.

 

Reply via email to