Hi,
Many thanks for all suggestions., I done a lot more thinking of my problems and come up with the following code:
procedure ConnectLiveTest( fdc: String );
var i: Integer;
begin
for i := 0 to dm.ComponentCount -1 do
if dm.Components[ i ] is TFDQuery then
begin
if fdc = 'Live' then
TFDQuery( dm.Components[ i ]).Connection:= dm.fdcLive1
else
TFDQuery( dm.Components[ i ]).Connection:= dm.fdcTest1;
TFDQuery( dm.Components[ i ]).Active := True;
end;
end;
This allows me to quickly switch between Test and Live MSSQL Server databases. And (whilst I'm still testing) appears to work OK.