procedure TForm1.Button1Click(Sender: TObject);
function SetDSetReadOnly(var theForm: TForm; ReadOnly: boolean): Boolean;
var
i: integer;
begin
for i := 0 to theForm.ControlCount - 1 do
begin
if theForm.Controls[i] is TAdoTable then
(theForm.Controls[i] as TAdoTable).ReadOnly := ReadOnly;
if theForm.Controls[i] is TAdoQuery then
(theForm.Controls[i] as TAdoQuery).ReadOnly := ReadOnly;
end;
Result := ReadOnly;
end;
begin
SetDSetReadOnly(Form1,true);
end;
var i:integer
begin
for i:=0 to Self.ComponentCount-1 do
begin
if Self.Components[i] is TadotableThen
begin
(Self.Components[i] as Tadotable).readonly:=False;
end;
end;
end;