Deploying .NET assembly for use with VB6 and Microsoft Access

I have a .Net assembly which I need to be able to use from three different program types;

-Microsoft Access (ver. 2000 I'm afraid)
-VB6
and VB.Net

Obviously I'm not too worried about that last one (VB.net) - as that's easy.

I've read a lot about adding assemblies to the GAC, but have never actually done it. I do have one assembly which I use in a VB6 app, but I don't use the GAC for this, I just deploy the TLB file and then call Regasm with the location of the TLB file specified as an argument.

In the playing around with all of this, trying to get it to work, I found it all quite messy. I was wondering if anyone has experience with getting MS Access to use a TLB file and if so, what the easiest way of deploying it all is. In my limited experience, I found that I had to put the TLB file in the same directory as MSACCESS.exe (i.e. C:\Program Files\Microsoft Office\Office) not the location of the MDB/MDE! Is this really the way it has to be?

If someone could outline the steps required as simply as possible, I would be most grateful.
LVL 1
JedNebulaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tbsgadiCommented:
Hi JedNebula,

The TLB just needs to be installed on the machine & set a reference to it in Access

Good Luck!

Gary
0
JedNebulaAuthor Commented:
Hi Gary,

Thanks for the reply.

The client machines will only be using a run-time version of Access so the references all need to be intact for the link to work. Sorry if I'm not explaining myself very well.
0
tbsgadiCommented:
You need setup the reference before you build your mde & include the TLB in your installation package
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

JedNebulaAuthor Commented:
OK that's fine, but where do I put the TLB file? I presume I need to deploy the dll file as well? - agian, where to?
0
ErezMorCommented:
hi
the way i used a few times in the past, is set the object "register for com interop" in the project properties in visual studio, then build the dll
now in vb or vba, go to references and brows to find the dll (you dont have to use a tlb, though it is friendlier)
now you can instaciate and use all objects from that dll just as any other objects you use in vb/vba
not too hard, is it?
0
JedNebulaAuthor Commented:
Hi ErezMor,

I am already registering for com interop in Visual Studio, but I get the error "Can't add a reference to the specified file" when trying to add the reference in access.

Regards,

Rawden.
0
JedNebulaAuthor Commented:
Sorry ErezMor,

I thought I would just clarify my last post. The error I get about not being able to set a reference only happens when trying to set it to the DLL, if I set it to the TLB file then it's fine. That's not really the problem though, the problem is deploying it to the client machines so that it'll work there too.
0
tbsgadiCommented:
You just need to install it with your application ,not Access
0
JedNebulaAuthor Commented:
when you say install it with your application, what do you mean? Do I just need to copy the TLB file, the DLL file and the MDB into the same directory because in my experience, that hasn't worked.
0
tbsgadiCommented:
Are you not preparing a setup?
0
JedNebulaAuthor Commented:
not currently no. I'm just trying to work out which method will work the best. either using the gac or not. Once I can get it to work manually, i'll then do a setup package sure.
0
tbsgadiCommented:
When you make the setup you simply add the TLB file to it
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JedNebulaAuthor Commented:
Okay thanks Gary. I got it working with the Visual Studio Setup package method, but do you have the steps for the manual process because I'm not using that to create my setup. Can it even be done?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.