Hallo,
indem Du eine private Variable einführst, die den Zusatnd der Connection speichert:
Delphi-Quellcode:
type
tuser = class(tobject)
private
fWasConnected:Boolean;
public
...
end;
...
function tuser.login(aUsername, aPassword,aIP,aDatabase: string): boolean;
begin
...
...
fWasConnected:=fmMain.MyConnection1.Connected;
Result:=fWasConnected;
end;
procedure tuser.ResetTelVarGeb;
var myQuery:TMyQuery;
begin
if fWasConnected then
begin
...
end
else
begin
...
end;
end;