并不需要在程序的运行过程中与excel进行读写,只要把数据导入就可以了。
先前的数据是录进excel表的,现在想把它们导进paradox表,有人告诉我用datapump可以实现,但是,不行啊,进行到“选择可用的表”的时候列表框里面确是空白,进行不下去。哪位大虾知道有什么方法可以实现,告诉我吧,困扰了一天了。。谢谢!!!!

解决方案 »

  1.   

    faint 难道这个问题太垃圾了么?
    自己up!
      

  2.   

    使用Delphi编写一段程序,使用两个ADO连接,一个连Excel,另一个连Paradox然后逐条append
      

  3.   

    ADOConnection1.ConnectionString := 
          'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\program files\co' +
          'mmon files\borland shared\data;Extended Properties=Paradox 7.x;P' +
          'ersist Security Info=False';
    ADOConnection2.ConnectionString :=  
          'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=abccompany.xls;Exte' +
          'nded Properties=Excel 8.0;Persist Security Info=False';
    然后,想干啥就干啥……
      

  4.   

    将excel文件另存为dbase格式,
    打开delphi下的detabase desktop,
    打开菜单tools\utilities\copy,
    选择你要拷贝的文件(*.dbf,即dbase文件),
    拷贝到另外一个目录,这时将它的后缀改成*.db,
    就得到了paradox格式,我以前经常用的方法。
      

  5.   

    to glink(飞天一狐) 你说的方法我试过了,不行,最后打不开表,不管是dbf或db都打不开。用Database Desktop建表的时候还有一个后缀为.px的东西,而用excel转化而来的就没有这个,是不是这个原因?思考ing.....to mengmengy(杨先生) 、budded(System is bussy.) ,你们说的方法我试一下。谢谢三位了
      

  6.   

    刚才试过两个ado的方法了,但是出错了,具体代码如下,请大虾指点procedure TForm1.Button1Click(Sender: TObject);
    var  i,j:integer;
        str1,str2,str3:string;
    begin
        table1.open;//table1指向excel文件
        table2.Open;
        j:=table1.RecordCount;
        try
         for  i:=0 to j-1 do
          begin
            str1:=table1.FieldValues['f1'];
            str2:=table1.FieldValues['f2'];
            str3:=table1.FieldValues['f3'];
            table2.Append; //当循环执行第二次的时候到这里出错
            table2.FieldByName('one').Value:=trim(str1);
            table2.FieldByName('two').Value:=trim(str2);
            table2.FieldByName('three').Value:=trim(str3);
            table2.Post;
            table1.Next;
         end;
        Finally
       table1.Close;
       table2.Close;
       end;
    end;
    第一次循环没有问题,第二次执行到appned就错了,错误为:
    'Invalid variant type conversion'