[AccessD] Broken Reference

Shamil Salakhetdinov shamil at users.mns.ru
Mon Aug 7 13:13:16 CDT 2006


Rocky,

With compiled state lost large MS Access applications will run slower.
That's the only penalty I know.
Recompiling can be done on run-time using SysCmd(...) but this technique is
not 100% safe I think and I don't know does it work with MS Access runtime
or not.

Instead of custom class you can use standard wrapper module with wrapper
functions - I'd prefix them e.g. using bta prefix string:

- btaCreateObject()
- btaWhatEverItDoes(...)
- ...
- btaDispose()

btaCreateObject() would create "BarTender.Application" object and would set
module level object variable to created object instance (if any). All the
other wrapper module's functions/subs would check if object variable is not
nothing and if it's not then make a call to "BarTender.Application" object's
methods or its related objects' methods.


--
Shamil
 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin -
Beach Access Software
Sent: Monday, August 07, 2006 9:30 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Broken Reference

Shamil:

"Setting references on run-time for MDBs will force your application
(FE)database to loose compiled state."  Any penalty for that?


"I'd also encapsulate all the calls to BarTender application's functions 
into a custom class."
A bit beyond my talents at the moment but I suppose I should learn how 
to do it.

But the late binding thing looks like the way to go.  I'll try it with 
Marty's snips.  I have a second machine without BarTender I can test it 
on.  What happens if I don't put all the BarTender functions in a custom 
class?


Rocky

Shamil Salakhetdinov wrote:
> Rocky,
>
> You can drop reference and use late (run-time) binding.
> Setting references on run-time will not work for MDEs. 
> Setting references on run-time for MDBs will force your application (FE)
> database to loose compiled state.
>
> I'd also encapsulate all the calls to BarTender application's functions
into
> a custom class.
>
> --
> Shamil
>  
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin -
> Beach Access Software
> Sent: Monday, August 07, 2006 7:00 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Broken Reference
>
> Dear List:
>
> I have a client who prints bar coded labels through an application 
> called Bartender (cute, huh?).  I wrote a production management system 
> for them which contains all the information in the db that they are 
> inputting manually into Bartender.  So the client asked me to add a 
> function to the app to run Bartender from the production system and that 
> is working great. 
>
> To do this I downloaded and installed the trial version of Bartender and 
> so was able to set a reference to it in the VBA code so I could run 
> Bartender from the client's app (stuff like Public BtApp As 
> BarTender.Application and Public BtFormat As BarTender.Format and Set 
> BtApp = CreateObject("BarTender.Application")).
>
> Problem is that the app won't run on any machine which doesn't have 
> Bartender loaded - it gets a broken reference error when the app opens.
>
> So I'm wondering how to handle this.  Perhaps I unset the reference in 
> the Tools-->References and set it when the bar code form opens?  Or is 
> there a way to trap and get around this error when the app loads?
>
> What's the best way to handle this?
>
> MTIA,
>
> Rocky
>
>   

-- 
Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.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