delphi Ado (mdb) update records

Posted by ml on Stack Overflow See other posts from Stack Overflow or by ml
Published on 2010-04-15T20:45:48Z Indexed on 2010/04/15 21:43 UTC
Read the original article Hit count: 671

Filed under:
|
|
|

I´m trying to copy data from one master table and 2 more child tables when i select one record in the master table i copy all the fields from that table for the other (table1 copy from ADOQuery the selected record)

procedure TForm1.copyButton7Click(Sender: TObject);
SQL.Clear;
SQL.Add('SELECT * from ADOQuery');
SQL.Add('Where numeracao LIKE ''%'+NInterv.text);// locate record selected in Table1 NInterv.text)
Open;
 // initiate copy of records
begin
   while not tableADoquery.Eof do
      begin
         Table1.Last;
         Table1.Append;// how to append if necessary!
         Table1.Edit;
         Table1.FieldByName('C').Value := ADoquery.FieldByName('C').Value;
         Table1.FieldByName('client').Value := ADoquery.FieldByName('client').Value;
         Table1.FieldByName('Cnpj_cpf').Value := ADoquery.FieldByName('Cnpj_cpf').Value;
         table1.Post; 
         table2.next;///
       end;
end;

//How can i update the TableChield, TableChield1 field´s at the same time?

do the same for the child tables TableChield <= TableChield_1
TableChield1 <= TableChield_2

thanks

© Stack Overflow or respective owner

Related posts about delphi

Related posts about ado