[AccessD] Sharing Class Modules in Acc 97 -More -

Drawbridge.Jack at ic.gc.ca Drawbridge.Jack at ic.gc.ca
Fri Oct 24 14:04:23 CDT 2003


Thanks John and Gumaro. Used the method suggested and got it to work OK in
97.
How would anyone "find" this if it weren't for this list? I searched the web
several times  and got zilch!.
Thanks.
jack

 

                      "John Colby"

                      <jcolby at colbyconsulting.c        To:       "Access
Developers discussion and problem solving"                            
                      om>
<accessd at databaseadvisors.com>

                      Sent by:                         cc:

                      accessd-bounces at databasea        Subject:  RE:
[AccessD] Sharing Class Modules in Acc 97 -More                           
                      dvisors.com

 

 

                      10/24/2003 09:37 AM

                      Please respond to Access

                      Developers discussion and

                      problem solving

 

 





I think you MUST use INSERT, not IMPORT.

INSERT class module, INSERT file.  IF I'm not mistaken it is the insert
file
that is the key.

BTW, it was those same two modules by dev and terry that got me looking at
how they did that.  I could use them from their lib, but if I imported them
into my lib I couldn't see them outside the lib.  HOW'D THEY DO THAT?  It
took about half a day to find the answer (back in 2000 or thereabouts).

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
ggonzalez at cccis.com
Sent: Friday, October 24, 2003 10:24 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Sharing Class Modules in Acc 97 -More







I also work with A2k day in and day out and I have gotten this method to
work.  I did for a couple of classes developed by Dev Ashish and Terry
Kreft (HTTP and FTP). I placed these classes in an mde file that several of
my applications reference.  I could send it to you if you are interested. I
will look at my instructions I may be missing a step.

Thanks, Gumaro





                      "John Colby"
                      <jcolby at colbyconsulting.c        To:       "Access
Developers discussion and problem solving"
                      om>
<accessd at databaseadvisors.com>
                      Sent by:                         cc:
                      accessd-bounces at databasea        Subject:  RE:
[AccessD] Sharing Class Modules in Acc 97 -More
                      dvisors.com


                      10/23/2003 07:59 PM
                      Please respond to Access
                      Developers discussion and
                      problem solving






>Note: The method noted above will NOT work in Access 2000. In fact if you
try the method above, when the file is imported, Access 2000 resets the
VB_Exposed property to false.

I work in Access 2k day in and out and it absolutely does work in A2K.  I
just tried it again to make sure.  Exported, changed, deleted the original
class, imported, cleaned up, saved, exported again.  The properties were
still True.

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
ggonzalez at cccis.com
Sent: Thursday, October 23, 2003 5:42 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Sharing Class Modules in Acc 97 -More







Try the Following:
The following is an undocumented way to expose your Access 97 class to all
your projects natively from your library database:
1.  Select your class in the development db.
2.  From the file menu select "Export", and export the class as a text
file.
(Don't choose the general "Save As".)
3.  Open the class module in a text editor, and you will find four
properties
at the top of the code, one of which is VB_EXPOSED=False. Change this
setting to true.
also change VB_Creatable =  to True
4.  Delete the class from the original db.
5.  Open a new class module (Insert menu.)
6.  Choose import file from the insert menu and then select the text file
for
your class, and save.

Voila! You now have a public class. Place the library db in the same folder
as any database. Add a reference it and then call your class natively as if
it were
included in the current database. Note: The method noted above will NOT
work in Access 2000. In fact if you try the method above, when the file is
imported, Access 2000 resets the VB_Exposed property to false. The quick
work around it to import your class with the VB_Exposed flag set to true in
Access 97, (creating a public class) and then, import that class into
Access 2000. This will preserve the VB_Exposed flag setting. Note: If you
want to start your new class as a public class, then simply use notepad to
create a text file which has VB_Exposed=True as its only line. When you
start your class, then import this file before you add code. if the above
does not work, save the db with the class to be called in the sam directory
as the application calling it.

Below is an example:
**************************************
Attribute VB_Name = CLASS NAME
Attribute VB_Creatable = True  !!!!!!CHANGE THIS TO TRUE!!!!!!!
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True  !!!!!!!!CHANGE THIS TO TRUE!!!!!!!
Attribute VB_Description = "CDO MAILING INFO"
 when ready to reimport the modified text file into the db it needs to
imported into a blank class module

Hope this helps



Further to note below-

I did move 2 class modules to  my library.mda type library.
When using another database, I did reset the references to the library.mda
When I look in the object browser, the class modules aren't there.

Any help /advice would be appreciated.
Thanks
jack

-----Original Message-----
From: Drawbridge, Jack: #CIO - BPI
Sent: Wednesday, October 22, 2003 5:39 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Sharing Class Modules in Acc 97


Is there a way to store Class Modules in a "Library" database or some
mechanism such that you can see the Class Modules from any database? I'm
using Acc97.

jack

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list