adam.intercity 0 Newbie Poster

I am new programmer in Delphi. I would like to ask how I convert a query into table foxro. For example

procedure TForm1.Button3Click(Sender: TObject);
var filetable:ttable;
     nomor:integer;
    begin
    QUERY2.Close;
    QUERY2.SQL.Clear;
    QUERY2.SQL.Add('SELECT status_k,tglkirim,status_r,penerima,kdpenerima,kode_r FROM  TRM WHERE STATUS_K<>" "');
    QUERY2.Prepare;
    QUERY2.Open;
    filetable:=ttable.create(self);
    with filetable do
    begin
       active:=false;
       DatabaseName:='D:\KURIR_SERVER';
       TableName:=(edit2.Text);
       TableType:=ttFOxpro;
       with FieldDefs do begin
       clear;
       Add('status_k',ftstring,30,false);
       Add('tglkirim',ftstring,10,false);
       Add('status_r',ftstring,30,false);
       Add('penerima',ftstring,30,false);
       Add('kdpenerima',ftstring,30,false);
       Add('kode_r',ftstring,30,false);
       end  ;
       CreateTable;
    end;
    filetable.Free;

,,,,,,how sould I program to convert Query2 into filetable
Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.