Subject Re: [IBO] how to use FocusedDataSource?
Author Helen Borrie
At 11:29 23/08/2008, you wrote:
>and the result always nil, why?

Perhaps you are testing at the wrong time, i.e., when no datasource has focus.

>if i use Transaction.IB_Session.FocusedDataset in each form the
>result is correct.
>may be i am wrong about ib_session? each Transaction start ib_session
>individual by automaticaly?

Transactions don't "start" an ib_session. There should be exactly one ib_session per thread. It is an object that must be created first, before all other data-aware objects in the thread. It is a "minder" for all other data-aware objects.

For the main thread, IBO creates an implicit tib_session in design time, as soon as you place any data-aware object in any form or datamodule. If you want to, you can create an explicit ib_session object for the mainform as your first object, or replace the implicit one with an explicit one. For a thread module you *must* create an explicit ib_session.