如何将Paradox保存为Excel文件。
要求使用DriveComboBox1指定驱动器,DirectoryListBox1指定目录。要有原代码。

解决方案 »

  1.   

    用sql2000的导入导出数据可以实现
      

  2.   

    to rongle1980(融乐) 要求在Delphi中用程序实现。
      

  3.   

    只能写代码,http://expert.csdn.net/Expert/topic/1418/1418337.xml?temp=.3620264
      

  4.   

    xlapp:=createoleobject('excel.application');
    xlbook:=xlapp.workbooks.add;
    xlsheet:=xlbook.worksheets[1];
    xlsheet.cells[1,3]:='一览表';
    xlsheet.cells[2,1]:='帐号';
    xlsheet.cells[2,2]:='姓名';
    xlsheet.cells[2,3]:='金额';
    xlsheet.cells[2,4]:='';
    xlsheet.cells[2,5]:='帐号';
    xlsheet.cells[2,6]:='姓名';
    xlsheet.cells[2,7]:='金额';
    i:=3;
    for j:=1 to adoTable1.recordcount do
    begin
        xlsheet.cells[i,1]:=''''+trim(adoTable1.fields[0].asstring);
        xlsheet.cells[i,2]:=trim(adoTable1.fields[1].asstring);
        xlsheet.cells[i,3]:=trim(adoTable1.fields[2].asstring);
    i:=i+1;
    end;
    xlapp.visible:=true;
      

  5.   

    procedure TForm1.EXCEL2Click(Sender: TObject);
    var
      eclApp,WorkBook:Variant;//声明为OLE Automation 对象
      xlsFileName:string;
      i,j,n:integer;
    begin
      if SaveDialog1.Execute then
      begin
      xlsFileName:=SaveDialog1.FileName;
      if fileexists(SaveDialog1.FileName) then DeleteFile(SaveDialog1.FileName);
      try
        //创建OLE对象Excel Application与 WorkBook
        eclApp:=CreateOleObject('Excel.Application');
        WorkBook:=CreateOleobject('Excel.Sheet');
      except
        ShowMessage('您的机器里未安装Microsoft Excel。');
        Exit;
      end;
      try    Screen.Cursor:=crHourGlass;
        workBook:=eclApp.workBooks.Add;
        i:=1; //EXECL表行号
        n:=0;//query字段N序号
        Query1.First;
        j:=1;
        for n:=0 to Query1.FieldCount -1 do
            begin
              eclApp.Cells(i,j):=Query1.fields[n].DisplayLabel;
              j:=j+1;
            end;
           i:=2; //EXECL表行号
           n:=0;//query字段N序号
        while not Query1.Eof do begin
              j:=1;//EXECL表列号
          for n:=0 to Query1.FieldCount -1 do
            begin
              eclApp.Cells(i,j):=Query1.fields[n].AsString;
              j:=j+1;
            end;
          Query1.Next;
          i:=i+1;
          end;    WorkBook.SaveAs(xlsFileName);
        Application.MessageBox('操作在没有警告的情况下正常结束!','完成',mb_ok+mb_iconinformation);
        WorkBook.close;
        eclApp.Quit;//退出Excel Application
        eclApp:=Unassigned;//释放VARIANT变量
        Screen.Cursor:=crdefault;
      except
        ShowMessage('不能正确操作Excel文件。可能是该文件已被其他程序打开,或系统错误。');
        WorkBook.close;
        eclApp.Quit;
        //释放VARIANT变量
        eclApp:=Unassigned;
      end;
    END;
    END;