谁说的详细点
我刚学才1礼拜

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var f:textfile;
        cc:integer;
        filename:string;
    begin
      adotable1.Open;
      filename:=ExtractFilePath(Application.ExeName)+'logs\'+datetostr(date)+'.txt';
      //showmessage(ExtractFilePath(Application.ExeName));
      assignFile(f,filename);
      rewrite(f);
      //adotable1.field
      with adotable1 do
      begin
        disablecontrols;
        first;
        while not eof do
        begin
         for cc:=0 to fieldcount-1 do
         write(f,fields[cc].asstring);
         next;
        end;
        writeln(f,'');
        first;
        enablecontrols;
      end;
      closefile(f);
    end;
      

  2.   

    谁说的详细点???你要多详细啊!!!一个思路:
    首先历遍sql查询出来的数据,然后将数据存入tStringList中,最后savetofile('c:\sql.txt')