Subject Re: [IBO] Accessing 2 dbs - invalid transaction handle (expecting explicit transaction sta
Author DennisCons
I am still having problems connecting to 2 IB dbs at the same time.

Previously I was getting a message "invalid transaction handle
(expecting explicit transaction start)" Thank you Jason for repling

I am now using the ISAPI demo from IBO, as ISAPI with 2 IB dbs is
where I want to end up.

I have got past the previous message by having a TIB_transaction for
each of my TIB_connections. Which seem to be what needed to do after
Jasons advice.

I have a TIB_session (first in creation order) , 2 TIB_connection , 2
TIB_transaction each referencing its own connection. 2 IBOquery each
selecting data from the appropriate db.

I am using DataSetTableProducers to generate an HTML table. ISAPI dll
works fine when the project was set up using only one db etc.

With the 2 dbs , at design time, I can connect & open both queries ,
so my connection strings , settings, appear ok

At run time as soon as I attempt to prepare IBOQUERY2 , i get an
except thrown from the IB_session object

ISC ERROR CODE:335544472 ISC ERROR MESSAGE: Your user name and
password are not defined. Ask your database administrator to set up
an InterBase login.

Code snipet :

if tr.InTransaction then tr.Commit;
tr.StartTransaction;

IBOQuery1.Prepare;
IBOQuery1.Open;

Response.Content := IBODatasetTableProducer1.Content;

IBOQuery1.Unprepare;
IBOQuery1.Close;

if tr2.InTransaction then tr2.Commit;
tr2.StartTransaction;

IBOQuery2.Prepare;
IBOQuery2.Open;

//using a TdatasetTableProducer to see i their is a difference, bur
never get this far.
Response.Content := Response.Content+DataSetTableProducer1.Content;

IBOQuery2.Unprepare;
IBOQuery2.Close;

if tr.InTransaction then tr.Commit;
if tr2.InTransaction then tr2.Commit;



Another couple of IBO questions.

Do I need a seperate transaction for each connection ... It would
appear
that I do.

What is the difference between a TIBOdatasetTable Producer and a
TDatasetTableProducer , both would appear to need to connect to a
TIBOquery
, and not TIB_query or TIB_cursor.



Dennis Cons



--- In IBObjects@y..., "Jason Wharton" <jwharton@i...> wrote:
> The invalid transaction handle problem is most likely because you
have a
> statement/dataset connected to a connection and transaction that
are not
> themselves referencing one another. This is something the BDE would
never
> allow you to do in the past. Now that you can have a transaction
separated
> out, you are just not using it correctly.
>
> No idea about a generic OLEDB provider for ADO.
>
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
>
> ----- Original Message -----
> From: "DennisCons" <denniscons@y...>
> To: <IBObjects@y...>
> Sent: Wednesday, May 29, 2002 10:07 AM
> Subject: [IBO] Accessing 2 dbs - invalid transaction handle
(expecting
> explicit transaction sta
>
>
> > I am new to using IBO..
> >
> > I am trying to convert an ISAPI dll , uses BDE , 2 IB databases, T
> > session
> > to IBO as I get BDE initialization problems.
> >
> > I am starting with a simple, using a TIBOdatabase , TIBOQuery ,
> > Tdatasource,
> > TDBgrid. ..can connect to one db, access data.
> >
> > When I try to connect to a second IB database using a second
> > TIBOdatabase, a
> > second TIBOQuery, datasource , grid etc. When I activate the
query I
> > get
> >
> > ISC error code : 335544332
> > ISC error message
> >
> > invalid transaction handle (expecting explicit transaction start)
> >
> > statement
> > TIBOinternaldataset "form1.iboquery1.(Tibointernaldataset>
> >
> >
> > Using a TIB_Transaction doesn't seem to help, although my
> > understanding was
> > you don't need it with TIBODatabase. I have tried many things with
> > alll the
> > properties etc, but cannot make it work.
> >
> > I have been using delphi for a long time now, is it just me or are
> > these IBO
> > components just confusing to work with.
> >
> >
> > Can anyone recommend a good OLEDB provider for IB / Firebird, I am
> > also
> > going to try to use ADO
> >
> > DennIs Cons.
> >
> >
> >
> >
> >
>
______________________________________________________________________
_____
> > IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> > without the need for BDE, ODBC or any other layer.
> >
>
______________________________________________________________________
_____
> > http://www.ibobjects.com - your IBO community resource for Tech
Info
> papers,
> > keyword-searchable FAQ, community code contributions and more !
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
> >