creating external reusable functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone:

I have been seriously trying to find options to externalize my functions /
procedures in my MS access application. I have tried using an MDE as a
library of code, but, unfortunately too late I found out that if the library
MDE changes, the main MDE must also be recreated. I have read from a gent
named Paul Overwaythat you can create add-ins or dll's. However, I have
never done this, nor can I find any resources on it.
I also have a lot of functions that use database connectivity to the current
project. Will I be able to use these function using an add-in or dll.

Any direction would be helpful.

Thanks so much,
David
 
Hi David,
yes, you need a VB6 for this. you create a new activex dll, add new class,
set it type to global multiuse - then you can copy-paste proc from normal
access module. for class modules you have to create public classes - then
you can use these classes in access. Do not forget to set a binary
compatibility for Activex dll project
If you have more questions - just ask here
 
Ok, Alex,

thanks, I am going to try begin this, ive never done it.
I do have some more specific questions:
1. can I use ado and dao library objects in my dll
2. My current project currently references a quickbooks dll and also a pdf
library MDE. Some of my procedures use the classes in these library. Can
these be referenced in my dll if I convert those Acces procedures to dll?
3. Can someone point me to a good online reference to create dll's?

Thanks,
David
 
Hi.
I have read from a gent
named Paul Overwaythat you can create add-ins or dll's. However, I have
never done this, nor can I find any resources on it.

It's not for the feint of heart or the impatient. Add-ins can be created
with some difficulty, but must be converted to a new file for each version of
Access. DLL's require a compiler capable of creating these special libraries
that follow COM standards. If you don't have any experience at this, it may
take some time to climb the learning curve.

Honestly, if you are not experienced, then it would be easier for you to
just recreate the dependent MDE files whenever the library MDE's have been
changed. However, if you would like to check it out, there's some online
documentation for creating Add-ins. Unfortunately, some of it is rather old
documentation (for Access 97 and 2K), so if you aren't running these versions
of Access, you won't be able to see many of the sample Add-ins in action
until you convert them to your current version. And if you don't already
know how, I've included links below to the documentation for creating
installable Add-ins for Access 2000 and 2002, which will shed some light on
the conversion process if you have a later version of Access.

http://www.microsoft.com/technet/archive/office/office97/maintain/off413ef.mspx

(Access 2K
http://msdn.microsoft.com/library/d...opg/html/deovrcreatingmenuaddinsforaccess.asp

(Access 2002
http://msdn.microsoft.com/library/d...ore/html/deovrcreatingmenuaddinsforaccess.asp

http://msdn.microsoft.com/library/d...opg/html/deovrcreatingmenuaddinsforaccess.asp

http://support.microsoft.com/default.aspx?id=143270

As for links to documentation for DLL creation, it depends upon what
programming languages you know well and what compilers you have access to. I
can't begin to point you in the right direction without knowing these, except
to the MSDN library.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
thanks again 69 camero,

I think you are right, I don't want to start with learning something
completely new. I already have the MDE library working. I do want a simple
solution. However, what I am going to be doing is this:
Customizable Main front end applications with each one having different
forms and report interfaces, but with the same coding. If I am to distribute
a Main front end and an external library, both should be MDE files, no?
If I need to release a patch for my library, how can I recreate the
dependant MDE ? I would have to recreate each users customized main library
and send it to them. Do you suggest any other method? Distributing the main
DB as a MDB ? Or is there a procedure I can create that would automate this
procedure?

Thanks for any help,
David
 
1. can I use ado and dao library objects in my dll

just like in MDE - add a reference to ado and dao. I also pass an
application object in order to have a reference to currentdb etc
2. My current project currently references a quickbooks dll and also a pdf
library MDE. Some of my procedures use the classes in these library. Can
these be referenced in my dll if I convert those Acces procedures to dll? yes

3. Can someone point me to a good online reference to create dll's?

i think you can find some in MSDN and in VB reference books
 
Hi.
If I am to distribute
a Main front end and an external library, both should be MDE files, no?

Ultimately, it depends upon your reason for creating the MDE files. If it's
for reliability and speed, then yes, create the MDE files. If it's to
protect the database application from unauthorized copying or for security of
User ID's and passwords, then that's a horse of a different color.

Since the database objects can be retrieved from an MDE file, the only thing
that can be hidden is the code. So, it depends upon how valuable the code
is, whether there are User ID's and passwords used, and/or how embarassed
you'd be if someone who was considering hiring you actually saw your code.
Most Access databases aren't worth hiding the code for because the code isn't
original or terribly clever. Competent Access developers can duplicate the
functionality, usually at a fraction of code of the original development.
If I need to release a patch for my library, how can I recreate the
dependant MDE ? I would have to recreate each users customized main library
and send it to them.

Distribute three files: library, front end and back end. The back end,
which holds the tables and relationships can be an MDB file. The front end,
which holds the other database objects, can be an MDE file. The library can
be an MDE file, too. When it comes time to update the library, create the
MDE file for it, then create the MDE file for the front end. Have each
client use Tony Toews' front end updater utility to automate the relinking of
the redistributed front end to their back end. Whatever installation
procedures each client uses for the original distribution of the library can
probably be reused for the update (with slight modifications for the back end
database file which already exists).

Please see Tony Toews' free autofe utility:

http://www.granite.ab.ca/access/autoFE.htm

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Hi again:

Thanks for your excellent answers.

Yes, I guess I do want to protect my code. Its pretty specific.
I have seen that TonyToews utility before thanks. I do mostly understand
about configuration. I guess what I was hoping to avoidwas having to
recreate the front end MDE for each user, and just distribute the library to
all users if there was an update. That would have saved a lot of time.

So, just a curious question, is it the same deal with dll's. If you change
the dll, must the front end MDE be recreated?

Thanks, and sorrry for so many questions...just want to get it right the
first time.

david
 
Hi.
I guess what I was hoping to avoidwas having to
recreate the front end MDE for each user, and just distribute the library to
all users if there was an update. That would have saved a lot of time.

Most professional developers automate as much as they can. Executing a
"build script" to automate whatever is done before each distribution makes
the repititous process less painful and requires less time.
So, just a curious question, is it the same deal with dll's. If you change
the dll, must the front end MDE be recreated?

It depends upon what is changed. If the change in the DLL requires a change
in the VBA code in the database application (such as changing the interface
of exposed functions used by the VBA code), then the MDE must be recreated
after the changes in the VBA code are made. If you've designed the
applicaton well and used encapsulation properly, this is rarely needed.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Thanks again for your expert opinion.
david

'69 Camaro said:
Hi.


Most professional developers automate as much as they can. Executing a
"build script" to automate whatever is done before each distribution makes
the repititous process less painful and requires less time.


It depends upon what is changed. If the change in the DLL requires a change
in the VBA code in the database application (such as changing the interface
of exposed functions used by the VBA code), then the MDE must be recreated
after the changes in the VBA code are made. If you've designed the
applicaton well and used encapsulation properly, this is rarely needed.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Back
Top