Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Application.OnException := AppException;
Tue, Nov 15 2022 1:22 AMPermanent Link

Ian Branch

Avatar

Hi Team,
I am having a play with this in conjunction with..
{code}
procedure TdmC.AppException(Sender: TObject; E: Exception);
begin
  if Assigned(E) then
    if (E is EDatabaseError) and (E is EEDBError) then
      begin
        if EEDBError(E).ErrorCode=EDB_Error_SessionNotFound then
          begin
            //SessionGone := true;
            DBS1.Connected := false;
            DBS1.Connected := true;
          end;
      end;
end;
{code}

So I am wondering, will this prevent other Database errors being handled in other areas?
If the Session is 'Disconnected' then reconnected per above, won't all the EDBTables & EDBQuerys have lost their State and reverted to 'Browse'?

Regards & TIA,
Ian
Tue, Nov 15 2022 4:53 PMPermanent Link

Terry Swiers

> If the Session is 'Disconnected' then reconnected per above, won't all the EDBTables & EDBQuerys have lost their State and reverted to 'Browse'?

If you close the connection, the databases and tables and queries associated with them will be closed, not just set to a "Browse" state.  
Tue, Nov 15 2022 6:01 PMPermanent Link

Ian Branch

Avatar

Hi Terry,
OK.  That makes it a different challenge.
Tks.
Ian
Image