using tlb on access

  • Thread starter Thread starter Roy Goldhammer
  • Start date Start date
Hi, Roy.
I got an tlb file which created on c# based on xsd

How can I use it?

Since it's a typelib file, you can add it to your VBA Project's list of
library references, as long as it has external hooks and is COM-compatible.
Then you can use it with early binding in your VBA procedures.

You can also declare each of its functions as external in individual code
modules, and then use them in your VBA code.

If it's not COM-compatible, or doesn't have external hooks for your VBA code
to "see," then you're out of luck.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Whell Camaro:

I used the reference to add it for my access database

The problem is that on the cs which the tlb created from has public
functions from classes which i can't see on VBA or VB.

The other problem is that when I'm trying to create new object using tlb
Classes i'm getting error:

dim obj as tlbObject

SET obj = new tlbObject:

Runtime error 80072000: could not find the file specified.

what is this error?
 
Hi, Roy.
The problem is that on the cs which the tlb created from has public
functions from classes which i can't see on VBA or VB.

That means there are no public hooks for external applications using the
Component Object Model (COM) to grab. You cannot use this file as a library
for Microsoft Access. You may need to rewrite it in a COM-compatible
programming language, such as VB or VC++ 5.0 or 6.0, if you can't rewrite it
in C# for COM.
dim obj as tlbObject

SET obj = new tlbObject:

Runtime error 80072000: could not find the file specified.

what is this error?

I suspect what Access really means is that it can't find the public hook at
that file's address.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Whell Camaro:

What is Public Hooks?

The same problem occur even when I run the same code on vb6.

What can I do on vb6 that will allow me to use the public functions and the
tlb?
 
Hi, Roy.
What is Public Hooks?

They're a programmer's nickname for the public functions in the library that
can be accessed by external programs. External programs "hook" the public
function to pass and retrieve values to and from the function's parameters.
The same problem occur even when I run the same code on vb6.

That's odd. I've never seen C# code compile in VB 6.0. ;-)
What can I do on vb6 that will allow me to use the public functions and
the tlb?

You'll have to post this question in a VB newsgroup, because it's been far
too long since I've programmed libraries in Visual Studio 6.0 to remember
all of the steps involved.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
On Sun, 30 Sep 2007 08:59:59 -0700, "'69 Camaro"

Actually I think the OP needs to post in a DotNet newsgroup, because
he apparently doesn't have a COM wrapper for his objects.

Another simple test to see if you have a COM-compatible component:
run:
regsvr32.exe <full path to component>

-Tom.
 
Back
Top