>> Reference dotNet.dll

J

Jonathan

Hi, using MS Access 2003 I would like to run a .dll created in vb.net 2008.
When I use Tools/References to select the file I get the error message "Can't
add a reference to the specified file."

Any idea why?

Many thanks, Jonathan
 
T

Tom van Stiphout

On Mon, 17 Nov 2008 17:19:00 -0800, Jonathan

Because MsAccess is not forward compatible. It doesn't know anything
about .NET-style DLLs.
Ask the .NET developer to add a COM wrapper.

-Tom.
Microsoft Access MVP
 
M

Michel Walsh

You can get the info in "Inside C#" Second Edition, Microsoft Press, Chapter
22. It is far from being complex. In summary, create an interface for the
method that will be available:


public interface IMyInterface
{
float whatever { get; set;}
void methodOne( );
...
}


and write code to implement it, with the attribute ClassInterface:

[ClassInterface(ClassInterfaceType.None)]
public class MyClass : IMyInterface
{
...
}


Compile the dll, and use REGASM (command line)

regasm MyClass.dll /tlb:MyClass.tlb


and use the tlb file as reference.


More details for the book given as reference:
http://www.amazon.com/Inside-C-Seco...bs_sr_1?ie=UTF8&s=books&qid=1227042782&sr=8-1



Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top