Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
Accessing the engine |
Sun, Jul 26 2009 4:34 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | How do I access the engine when the datamodule on which its declared IS NOT in the unit I want to access it from?
Think of this scenario: Create a general purpose component which will be used in several applications. This component will use ElevateDB and in it I want to check one or more of the engines properties (eg UseLocalSessionEngineSettings) to decide on how the component should do something. Obviously if I drop this component onto a form in several different apps it won't be accessing the same engine, in many cases the datamodule, and even the engine, will not have the same names (eg in one app the engine is TfREngine and in another MyMEngine). So two questions really: 1. How do I detect if there is an engine component already there? 2. How do I access its properties? Roy Lambert |
Mon, Jul 27 2009 3:41 PM | Permanent Link |
"Jeff Cook" | Roy Lambert wrote:
<snip> > > 1. How do I detect if there is an engine component already there? > 2. How do I access its properties? > > Hi Roy Definitely not an expert in component construction here ... You could make the datamodule a property of your new component, then you could find the engine component like this:- with datamodule do begin for i := 0 to ComponentCount - 1 do begin if (Components[i] is TEDBEngine) then // or whatever it is called begin PropertyImLookingFor := (Components[i] as TEDBEngine).ThisProperty; break; end; end; end; ? -- Jeff Cook Aspect Systems Ltd www.aspect.co.nz + Joan and Jeff Cook The Cooks Oasis www.cookislandsoasis.com |
Mon, Jul 27 2009 4:19 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< How do I access the engine when the datamodule on which its declared IS NOT in the unit I want to access it from? >> Use the global Engine() function in the edbcomps.pas unit. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Jul 28 2009 2:33 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Jeff
Good try but you missed the critical phrase "used in several applications" ie I'd need the datamodule from each app. Roy Lambert |
Tue, Jul 28 2009 2:38 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Tim
I was hoping that would be the answer, but couldn't, and can't understand how Roy Lambert |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |