Page 1 of 1

Application does not close !

Posted: 27.01.2006, 17:02
by open_devel
I use mysql 3.23.58, windowsxp sp2, c++builder6 sp4. I need to make some changes over my finished application. There was no problem when i finished it but now i have a serious problem. Even if i close the application while working with IDE, the window closes and (unfortunately) debugger freezes. When i run it standalone, i close it and main window dissapers. But this time i launch task manager and i see that it is still running!

I designed a simple project and saw that when ZConnection is connects to the database, the problem occurs. Although I close it using disconnect method, it is useless...

I will be happy for your help :wink:

Posted: 27.01.2006, 22:25
by btrewern
IIRC this has been mentioned before somewhere on this (or the previous) forum. It seems to be a MySql thing relating to the client dll. It might be worth having a look on the MySql forums for a fix.

Ben

same problem with firebird 1.5

Posted: 27.01.2006, 23:43
by open_devel
I test it using Firebird 1.5 but i face same problem again :(

Posted: 28.01.2006, 12:18
by zippo
Try to add a button with the event ZConnection1.Disconnect

Then try the following
- Press the button and then close the application. This way you check if the DLL is unloaded OK. The problem remains?
- Modify the source to start without connecting. Start the application and then turni it off. This way you can detemine if the bug is related to DLL loading/unloading (the DLL is callend upon .Connect is fired).

Posted: 28.01.2006, 13:54
by open_devel
I did all of them. I start the app without connecting. There's no problem when i close it without connecting. I used command buttons to start and stop the connection. It connects and disconnects without any problem. But if I start the connection, my app does not terminate even if i close the connection!

Application does not close !

Posted: 31.01.2006, 14:34
by martinalex
I have a similar error with Zeos sometimes. I use D7, Zeos 6.5.1 and Firebird 1.5.2.

When I close my application I have an exception at disconnect. The exception happens in procedure TZConnection.Disconnect (ZConnection.pas);
I could trace the error down a bit.

In TZConnection.CloseAllDataSets
the error occurs for the last dataset to be closed. The except ignore statement does not work, because the error is raised below.

try
Current.Close;
except
// Ignore.
end;

In ZDbcInterbase6.pas, TZInterbase6Connection.Close
the error happens in the following statement
FPlainDriver.isc_detach_database(@FStatusVector, @FHandle);

there is not much below, so I think that it's a dll error.
The error does never happen when the program only reads the database.

So far I don't know a workaround.

The error message is:
Exception Fehler:
SQL Error: invalid statement handle. Error Code: -901. Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements
Address: 561547
The operation completed successfully

Posted: 31.01.2006, 18:25
by open_devel
I designed a small application based on Firebird 1.5.2 using ZEOS DBO 6.1.5. Same problem goes again. It seems to be closed but I can see that the application doesnt close from task manager. I tried again by installing ZEOS DBO 6.5.1 bu that was useless ! Finally I reinstalled windows xp sp2 without installing any application. And I saw that there is no problem. Maybe we face these problems because of a replaced DLL. But i tried different connectivity utilities and faced no problem :(

Error 901

Posted: 17.03.2006, 23:40
by DrMule
I am getting Error 901, Delphi 7, embedded Firebird 1.5, traced to this level
(hope this helps):
procedure TZInterbase6Connection.Close;
begin
.
.
.
if FHandle <> nil then
begin
FPlainDriver.isc_detach_database(@FStatusVector, @FHandle);
FHandle := nil;
CheckInterbase6Error(FPlainDriver, FStatusVector, lcDisconnect);
end;