By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

Using a .Net class lbrary in Access 2000

P: n/a
I have a class library (clsTestLib) that was created in VB.Net that I
would like to use in Access 2000. I created a typelib for the class
using regasm.exe. I am able to refernce (add a reference) the dll
using the generated typelib. In Access, when I run the Access
application and declare a new instance of the class as follows

Dim MyTest As clsTestLib.Class1
Set MyTest = New clsTestLib.Class1

I get an error Run-time message that says "File or assembly name
clsTestLib, or one of its dependencies, was not found".

If I do the same thing in a VB6 project I get the same error message
when I run the project in the IDE. However, if I compile the project
and run the executable file the program works fine, I do not get the
error message and I am able to access the class just fine.

What do I need to do to be able to acess my class library in Microsoft
Access 2000?
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

I had this problem myself and have just figured it out...

If your class isn't registered in the GAC your Microsoft Access 2000 program
directory should contain all output, ie .dlls etc generated from your .Net
project.

This directory is usually "C:\Program Files\Microsoft Office\Office10".

The reason for this, as I understand it anyhow, is that MSAccess.exe is the
host application, ie the applications domain and as with .Net if the
required assemblies aren't available in the GAC then the host application
directory must contain them, as private assemblies.

I've done this and my Access 2000 application successfully calls my .Net
assemblies exposed to Com.

Regards,

Simon Rear

"RichGolebiowski" <Ri****************@hotmail.com> wrote in message
news:7b**************************@posting.google.c om...
I have a class library (clsTestLib) that was created in VB.Net that I
would like to use in Access 2000. I created a typelib for the class
using regasm.exe. I am able to refernce (add a reference) the dll
using the generated typelib. In Access, when I run the Access
application and declare a new instance of the class as follows

Dim MyTest As clsTestLib.Class1
Set MyTest = New clsTestLib.Class1

I get an error Run-time message that says "File or assembly name
clsTestLib, or one of its dependencies, was not found".

If I do the same thing in a VB6 project I get the same error message
when I run the project in the IDE. However, if I compile the project
and run the executable file the program works fine, I do not get the
error message and I am able to access the class just fine.

What do I need to do to be able to acess my class library in Microsoft
Access 2000?

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.