ComponentCount--组件数量
for i:=0 to ComponentCount-1 do //对窗口组件进行遍历
begin
if self.Components[i] is TFDQuery then
begin
(self.Components[i] as TFDQuery).Connection:=Conn;
(self.Components[i] asTFDQuery).FetchOptions.Mode:=fmAll;
end else
if self.Components[i] is TFDStoredProc then
begin
(self.Components[i] as TFDStoredProc).Connection:=Conn;
end else
if self.Components[i] is TDBGridEh then
begin
(self.Components[i] as TDBGridEh).EvenRowColor:=clWindows;
(self.Components[i] as TDBGridEh).OddRowColor:=$00FDFDF4;
end;
end;