Hi, I was edited this code for my problem in home. See the code below, I replace:
function TZConnection.GetInTransaction: Boolean;
begin
CheckConnected;
Result := not FAutoCommit or (FExplicitTransactionCounter > 0);
end;
with:
function TZConnection.GetInTransaction: Boolean;
begin
try
CheckConnected;
except
Result:=False;
Exit;
end;
Result := not FAutoCommit or (FExplicitTransactionCounter > 0);
end;
I've the story with this problem . Sometime my application fail when connect to database, application still running, but property of Connected=False. When I closing the application, method of CheckConnected raising the error, and my application can't close , I must terminated with task manager , or write code Application.Terminate.
You can try for get the error message with fail login, such enter the wrong of user name or password, until the main form showing. And then try close the main form, the moment a method GetInTransaction executing method CheckConnected and raising the error.
I use postgresql-8.1, Turbo Delphi and 6.6.2-RC version of Zeos.
Or you have other solution, my be any code must be edited, but not this code.
Thanks
dayat
Error while closing form with TZConnection.Connected=False
Moderators: gto, cipto_kh, EgonHugeist, mdaems