if Table1.Active=True then Table1.Close;
for I := 0 to ComponentCount - 1 do if Components[I] is TTable then (Components[I] as TTable).Close;