Subject Re: [IBO] Inheritance problem (repost)
Author clementdoss
Hello Helen,

Thanks for helping me :)

I am inheriting from a CustomAccess datamodule, that is the base
class for a BDEAccess DM, ADOAccess DM, IBOAccess DM. They are
overriding some funtions defined in CustomAccess.
This is what I am doing:

TCustomAccess = class(TDatamodule);

TBDEAccess = class(TCustomAccess); // TDatabase on it
TADOAccess = class(TCustomAccess); // TADOConnection on it
TIBOAccess = class(TCustomAccess); // TIB_Connection on it

Then for my customer Specific program I use:

TACMEIBOAccess = class( TIBOAccess ) ;// To use IBOAccess :)

When designing, when I try to add some fields in order to setup
Display Name and other stuff, I got this message... Needless to say
that the other DM worked :(

--- In IBObjects@y..., Helen Borrie <helebor@t...> wrote:
> At 09:06 PM 19-09-02 -0300, you wrote:
> >Hi,
> >
> >I am using D5, IBO 4.2.Gc.
> >
> >I created a Datamodule and dropped a TIB_Connection on it.
> >I named it IBO_Access.
> >I create a second Datamodule that inherits IBO_Access, I named it
> >IBO_Access1. This will be the one that I will use in my project
> >clause).
> >
> >I create a Datamodule and dropped a IBOQuery on it.
> >I am using IBO_Access1 in Uses clauses.
> >I set IBOQuery1.IB_Connection to IBO_Access1.IB_Connection.
> >I can enter the query, but I cannot AddFields using the Fields
> >There=B4s an error that says that a blank statement cannot be
> >I double checked all my connections and the only blank statement I
> >have is in IBO_Access (Parent datamodule).
> >When I close the application and reopen it, I have 2 login forms to
> >enter. The first one fills the Database name correctly ( I guess
> >the derived one IBO_ACCESS1 where all the info is filled at design
> >time). The second one is totally blank (No info is filled) it must
> >from IBO_Access (parent Datamodule).
> >
> >Can I inherited IB_Connection from a parent Datamodule?
> >Should I be doing this?=20
> I saw your earlier post and thought it was something Jason would
> on. However, Jason is sick at present, so I will just make a few
> comments...not understanding why you need to use inheritance at all.
> AFAIK, by inheriting the ib_connection, you are inheriting the
> of the ancestor connection, not the connection itself. For both
> datamodules to use the *same* connection, you would need (I think)
to set
> the dbHandleShared property true on the descendant connection. But
I'm not
> certain that the logic exists to do this handle-sharing with a non-
> connection.
> Why do you need inheritance for a datamodule? If you just want to
> typing, why not use a TIB_ConnectionSource on your secondary data
> Actually, I just add my primary DM (the one that has the
IB_Connection) to
> the uses clauses of my dependent DMs. This makes the primary DM's
> ib_connection visible to the secondary DM. This is not because I
> IB_ConnectionSource is a bad idea (I certainly don't!!) - it's just
what I
> have always done and it works fine.
> Helen