dbTalk Databases Forums  

Late binding to library database

comp.databases.ms-access comp.databases.ms-access


Discuss Late binding to library database in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Owen
 
Posts: n/a

Default Late binding to library database - 06-16-2011 , 01:26 AM






Hi,
I have created an mde which sends email using simple SMTP (let's call
it Email.mde). I want to reference it in another mde, called Main.mde.
I can do this OK if I set a reference in Main.mde, but most of the
time Main.mde will be installed without Email.mde. So I want to use
late binding in Main.mde to call a form in Email.mde. The idea is that
Main.mde will call Email.mde if it exists, but not have reference
errors if it doesn't exist.

I've read extensively on late binding, but can't find a method to do
it, other than creating a reference in code in Main.mde, and I believe
this won't work in an mde.

I don't want to put the Email.mde code into Main.mde, because
Email.mde also contains some data tables that I'd rather not have to
link to otherwise.

Is there a way to do this?

Owen

Reply With Quote
  #2  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Late binding to library database - 06-17-2011 , 12:25 PM






Owen <google (AT) healthbase (DOT) com.au> wrote in
news:c4d9977c-03b5-487c-9c51-faeff712206e (AT) z15g2000prn (DOT) googlegroups.co
m:

Quote:
Is there a way to do this?
Not in the traditional way of using actual late binding. Instead,
you have to structure your library so that all of its functionality
is available via functions, and then use Application.Run to execute
its functions.

Or, it might be that you can open the database with DAO and use Run
on the database's functions, but you still have to have wrapper
functions around them. I do know that any time you use .Run like
this, the project you're running gets listed in the project viewer
in the VBE, so you might be able to trick it into working like early
binding by calling one function with Run and then everything else
would be available as with a reference. But I'm just speculating
here -- I like to keep my add-ons segregated from my apps (to
prevent breakage of the app when the add-on is missing), so I
consider the extra "distance" a feature, not a disadvantage.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #3  
Old   
Owen
 
Posts: n/a

Default Re: Late binding to library database - 06-20-2011 , 07:26 PM



Thanks for the reply David.

This seems a little tricky for my purposes. So I've just added the
email code to the front end Main.mde and had it attach to the tables
in the separate EmailData.mdb. When Main.mde opens, it checks whether
EmailData.mdb exists, and if it does, it uses the email code in
Main.mde. If EmailData.mdb doesn't exist, it just uses the usual code
to call the default email handler. Not my preferred solution, but it
works.

Thanks.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.