Subject Re: [IBO] Updating master detail tables - 2nd post
Author Robert Martin

I suspect it is what Daniel suggested. At design time you are setting
Connected to true. I dont use the IB_ components but I suspect it works
the same as the IBO components. Most likely this is accidental, if you
mannually change the property to true it can cause this error, but
bringing up field / property editors on Query / table components will
automatically set connected to true. This will cause your error.

All you need do to get around this is to have code that always makes
sure connected = false before attempting to connect. Also remember to
make sure connected = false before doing a release build. Otherwise
when you app starts it will try and connect to your dev DB which may not
be in the same location / Alias on your clients machine.

Hope this helps

On 1/06/2011 11:02 a.m., Terry Black wrote:
> Hi, I have 2 Delphi applications that are working on the one Firebird
> database. Let me explain. The first application uses 3 tables
> relationally linked to each other. It is a many to many relationship.
> This application has been working well for 6 months. The second
> application is my developmental application which uses the same firebird
> database which is looking at adding records to the 3 tables. So I am
> constantly changing and compiling the second developmental application.
> At some stage it hangs and then fails to compile. Giving me the
> 'EIB_ConnectionError - Cannot change while connected'.
> I can still use the original application which uses the same database.
> If I rebooted the computer my developmental application would still not
> compile. So this looked like there was something wrong with my code in
> the developmental application. However, I find this morning that it
> compiles easily. I have not changed anything since it was unable to
> compile yesterday.
> I am not sure what is happening. It looks like I opened a transaction
> which for some reason would not close yesterday. This prevented my
> developmental application opening the Firebird database. Today it is all
> fine. I don't understand it.
> Terry
>>>> Daniel Rail<daniel@...> 31/05/2011 10:00 pm>>>
> Hi,
> At May-31-11, 4:26 AM, Svein Erling Tysvær wrote:
>> I think she meant that she thinks you're doing something like:
>> TIB_Connection1.Connect;
>> TIB_Connection1.Username:=...
>> and you cannot change username or password when you're already
>> connected. Actually, I don't think it has to be username or password
>> that is changing, I think it can also be that you try to change the
>> name of the database, maybe even the name of a database belonging to
>> a started transaction (at least I doubt it is possible to close a
>> connection whilst its transaction is running).
>> You have to find the exact place in your code that causes the
>> error, this kind of showstoppers luckily tend to be relatively easy
>> to locate (and easy to understand why gives this error once you find
> the exact line).
> It might also be that TIB_Connection.Connected := True at compile
> time, and then trying to change the server and path at runtime.