Solved

Help adding .dll file to MS access

Posted on 2011-02-18
11
550 Views
Last Modified: 2012-05-11
Hi,

I was wondering if someone can help.
I have created a custom .dll file for an application using visual studio 2008 and am trying to add this into a Microsoft access project.

The version of access is 2003. I have tried going to the code window clicking on tools-->references and browsing to the .dll file.
I then receive the following message “Can’t add reference to the specified file”  

All of these .dll files add fine to visual studio but I need to be able to use this in a Microsoft access application. Any help would be appreciated.

Regards,

Ross

Screens.docx
0
Comment
Question by:ross13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 57
ID: 34928163
Ross,

  I've never written a .DLL for Access, but I know that some need to be registered with Regsrv32 before they can be used.  Only a native .DLL can be used without registering.

JimD.

0
 
LVL 75
ID: 34928213
"Only a native .DLL can be used without registering."
Not sure what you mean by 'native', but the Lebans Mousewheel Hook DLL for example does not need to be registered, as well as a couple of others.

mx
0
 
LVL 57
ID: 34928264

  It's may understanding that "native" means that its been compiled for use with a specific chip. I've heard other definitions as well, but that seems to be the main one.  Since I've only written one DLL in my life, I don't claim to be an Expert.  All I know is that there is a difference.

  Some need to be registered and some do not.  As you pointed out, Leban's mousehook DLL does not, while vbSendMail.DLL does.

JimD.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 57
ID: 34928306

  Actually, I think in terms of DLL's, it has something to do with the interface that it presents and how that gets exposed to the calling program.

JimD.
0
 
LVL 75
ID: 34928321
" ....and how that gets exposed to the calling program."
Yes ... that sounds more like what the issue might be ...

mx
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 34928731
You need to create type library and add the type library as a reference

Project Properties > Compile Tab > Register for COM interop

OR

Type Library Exporter (Tlbexp.exe)
http://msdn.microsoft.com/en-us/library/hfzzah2c(v=vs.80).aspx
0
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 500 total points
ID: 34928764
My bad wrong reference should be:

Assembly Registration Tool (Regasm.exe)
http://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.71).aspx
0
 

Author Comment

by:ross13
ID: 34932898
I received the following message after i tried that.

Warning      2      "C:\Documents and Settings\RRobertson\My Documents\Visual Studio 2008\Projects\fsc_runningTotal\fsc_runningTotal\bin\Release\fsc_runningTotal.dll" does not contain any types that can be registered for COM Interop.      fsc_runningTotal
0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 500 total points
ID: 34932939
Did you mark it as COM Visible? Projects properties > Application Tab > Assembly Information button > select "Make assesmbly COM visible"
0
 

Author Comment

by:ross13
ID: 34933408
Yeah.
I tried a build --> rebuild and i get the warning message reported above.
If i just hit build the warning goes away.
I tried going into the access application after doing this in visual studio and browsing and selecting the .dll and i still get the error message “Can’t add reference to the specified file”  
0
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 500 total points
ID: 34933559
You don't select the DLL you have to add the .TLB file as the reference. The DLL is a NET assembly not a COM object ;)

Look in your Bin folder for the .tlb file
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question