Connection not defined by descendant of TmyConnection
Posted: Fri 28 Nov 2008 08:36
In our application we need an extension for each dataset. So we tried to extend the connection component "TMyConnection" in this way:
We use Delphi-5 and MyDAC-5.55.0.39.
Where is the fault?
At runtime the message "Connection is not defined." appears. At designtime setting of the connection to the above dataset type works well, setting of the property "Active" too.TMCyConnection = class(TMyConnection)
private
protected
public
User : string;
constructor Create(AOwner:TComponent); override;
destructor destroy; override;
published
end;
TMCyXQuery = class(TMyQuery)
private
FConnection : TMCyConnection;
procedure SetConnection(Connection:TMCyConnection);
protected
public
published
property Connection:TMCyConnection read FConnection write SetConnection;
end;
constructor TMCyConnection.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
User := '???';
end;
procedure TMCyXQuery.SetConnection(Connection:TMCyConnection);
begin
if FConnection Connection then begin
FConnection := Connection;
end;
end;
We use Delphi-5 and MyDAC-5.55.0.39.
Where is the fault?