indy TCP server-client

Hi,

I looked at an example for sending a record via an Indy-TCP-client  to an
indy-TCP-server and tried to combine this with information from an
ADO-dataset.
Sending and receiving data and putting these in editboxes is no problem.
(IdTCPServer1Execute)
Also using the text from the editboxes from updating a dataset is no
problem. (Button1Click --> UpdateData)

But, when I call "UpdateData" from "IdTCPServer1Execute" I get an
access-violation.
(all this on the server-side)

Can someone explain this ?

Thanks,
Bas De Smedt

client-side:
-----------
procedure TForm_main.Button1Click(Sender: TObject);
  begin
  with IdTCPClient1 do
   begin
   Host := Edit1.text;
   Port := StrToInt(Edit2.text);
   Connect;
   WriteBuffer(TempRecord,SizeOf(TempRecord),true);
   ReadBuffer(TempRecord,SizeOf(TempRecord));
   Disconnect;
   end;

  Edit6.Text := IntToStr(TempRecord.Nummer1);
  Edit7.Text := IntToStr(TempRecord.Nummer2);
  Edit8.Text := TempRecord.info;
  end;

server-side:
------------
procedure TForm_Secretaris.IdTCPServer1Execute(AThread: TIdPeerThread);
  var
  i : integer;
  begin
  Edit4.Text := IntToStr(StrToInt(Edit4.Text)+1); // this funcion seems to
be called 2 times for every Button1Click on the client-side ?!!??

  AThread.connection.ReadBuffer(TempRecord,SizeOf(TempRecord));
  Edit1.Text := IntToStr(TempRecord.Nummer1);
  Edit2.Text := IntToStr(TempRecord.Nummer2);
  Edit3.Text := TempRecord.info;
  AThread.connection.WriteBuffer(TempRecord,SizeOf(TempRecord),true);

  //UpdateData; // access violation
  end;

procedure TForm_Secretaris.Button1Click(Sender: TObject);
  begin
  UpdateData; // works fine
  end;