将数据库数据读出来,在全部转换为string,不就可以存为txt文件了吗?doc文件用一个wordApplication即可。也不知我的理解得对不对,因为不是特别明白你的意思!

解决方案 »

  1.   

    我写了一段,但编译时通不过,希望高手看看下面的button的代码有和错误
    procedure TForm12.Button2Click(Sender: TObject);
    var
    sourcefile:string;
    destfile:string;
    begin
      sourcefile:='buy.db';
      if edit1.Text='' then
      showmessage('请输入文件存在地及文件名...')
      else
      begin
      destfile:=edit1.Text;
      copyfile(sourcefile,destfile);
      end;
    end;
      

  2.   

    能给出错误提示吗?
    从以上程序看,只可能在copyfile处出错,copyfile函数我没有用过(可能是我忘了),你有没有uses copyfile的声明文件(具体什么文件我也忘了)呢?
      

  3.   

    是在copyfile处出错的,但我不知道错在哪里,如何修改
      

  4.   

    用copyfile怎能把db文件变成txt文件呢?
    用bde的BatchMove吧,
    不过要选好目标数据库类型为text driver.
    关于batchMove,Delphi本身自带例程
      

  5.   

    先建立一个别名 用 一个query把 这个数据库打开
       例 
      With Query do begin
         if Active then close;
          Sql.clear
          sql.add('select * from db')
          open
          SavetoFile('your filename ');
          Close;
       End;