Hi,
i am a little bit stuck here, i get the following exception message :
Operation aborted
in method (Unit Aurelius.Comp.Connection)
function TAureliusConnection.CloneAdaptedConnectionWithRtti: TComponent;
var
Rtti: TRttiContext;
Prop: TRttiProperty;
Props: TArray;
ConnectionProp: TRttiProperty;
begin
if AdaptedConnection = nil then Exit(nil);
Rtti := TRttiContext.Create;
try
Result := TComponentClass(AdaptedConnection.ClassType).Create(nil);
try
Props := Rtti.GetType(AdaptedConnection.ClassType).GetProperties;
// Set events before properties
for Prop in Props do
if (Prop.Visibility = mvPublished) and Assigned(Prop.PropertyType) and
(Prop.PropertyType.TypeKind = tkMethod) and Prop.IsWritable and Prop.IsReadable then
Prop.SetValue(Result, Prop.GetValue(AdaptedConnection));
ConnectionProp := nil;
// Now properties
for Prop in Props do
if (Prop.Visibility = mvPublished) and Assigned(Prop.PropertyType) and
(Prop.PropertyType.TypeKind <> tkMethod) and Prop.IsWritable and Prop.IsReadable then
begin
if SameText(Prop.Name, 'Connected') or SameText(Prop.Name, 'Active') then
ConnectionProp := Prop
else
// ugly hack to not clone this property in UniDac
// Later we should refactor this in a way that each adapter adds specific logic
// for cloning
if SameText(Prop.Name, 'DefaultTransaction') and SameText(AdaptedConnection.ClassName, 'TUniConnection') then
// nothing
else
Prop.SetValue(Result, Prop.GetValue(AdaptedConnection));
end;
if ConnectionProp <> nil then
ConnectionProp.SetValue(Result, ConnectionProp.GetValue(AdaptedConnection));
except
Result.Free;
raise;
end;
finally
Rtti.Free;
end;
end;
I am tryin to retrive entity data from a MS-SQL Server, using UniDac access components.
Any clue what is going wrong....
br
Michael