Referencing classes in librarys databases

  • Thread starter Thread starter ToniMaura
  • Start date Start date
T

ToniMaura

I create a library database with some classes. When I
tried to see this classes in a database (with reference to
that libray) via code (Set gobjErr As New cErrHandler)...
access don´t 'know' de cErrHandler object. I can see the
function declared in the database library.
What I am doing wrong?. Is not posible share classes from
a database library?.
Thanks
 
See http://www.mvps.org/access/modules/mdl0034.htm

--
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com


I create a library database with some classes. When I
tried to see this classes in a database (with reference to
that libray) via code (Set gobjErr As New cErrHandler)...
access don´t 'know' de cErrHandler object. I can see the
function declared in the database library.
What I am doing wrong?. Is not posible share classes from
a database library?.
Thanks
 
Thanks, now I can see the class but access give me an
error (New use no valid) in the New clausule of the code:
Public gobjErrorHandler as LibErrHandler


Set gobjErrorHandler=New LibErrHandler

What's wrong now?
 
The edits should result in the following:
Attribute VB_Creatable = True
Attribute VB_Exposed = True



Thanks, now I can see the class but access give me an
error (New use no valid) in the New clausule of the code:
Public gobjErrorHandler as LibErrHandler


Set gobjErrorHandler=New LibErrHandler

What's wrong now?
 
I do it, but when I import it to access, the Attribute
VB_Creatable is changed to false 'automatically' ...
 
I do it, but when I import it to access, the Attribute
VB_Creatable is changed to false 'automatically' ...

Is this a class module or standard module? I don't think you need to
change this in order to expose the classes from a library (which doesn't
work in VBA6 if I'm not mistaken).

-- Dev
 
A class module. If I change the vb_exposed atributte (like
you explain in your web) access expose me the class, but
then I c'ant use a New clausule whit it...
 
If I change the vb_exposed atributte (like
you explain in your web) access expose me the class, but
then I c'ant use a New clausule whit it...

It shouldn't. What error message do you get? What version of Access are you
using?

-- Dev
 
Back
Top