Subject Re: [IBO] What's a connection for?
Author Helen Borrie
At 05:35 AM 22/08/2005 +0000, you wrote:
>Alas, after reading so much about transactions and the like, I am
>still wondering when do I need to use the TIB_Connection component.

Only when you want to connect to a database. :-)

>Looking at samples, I see that sometimes there is a connection
>component sometimes not.

There is always a connection *object* in an IBO app. It is what provides
the connectivity from your application to the server and the database, by
way of the API (which is what the client library is).

When there's not a TIB_Connection object, per se, you'll find there is a
TIBODatabase - which wraps together a single, embedded TIB_Transaction and
an IB_Connection. This hybrid class is for compatibility with the old BDE

>Forgive my ignorance, which specific item in
>the help file, online faq or any other resource I need to look into to
>once and for all enlighten myself in this regard?

TIB_Connection, in the help file. The essential properties are Server,
Path and Protocol. Also, by one means or another, the connection will need
a User and Password. The other property that will be essential if your
database has a default character set will be the CharSet property: it must
be set to match the database's charset.

>One specific
>question: If an ib_transaction is present, and an ib_connection is
>present which has its defaulttransaction set to the ib_transaction,
>and I have ib_queries with ib_connection property set to
>ib_connection, ib_transaction property nil, what happens to their
>transaction? Will one be created for each query or use the
>defaulttransaction of the ib_connection?

As long as the IB_Connection property is set (and it should be), the
statement object will use the connection's default transaction. You're
doing pretty OK here if you use an explicit transaction object hanging off