我先在ODBC建立了一个User Dsn:选择Microsoft Visual FoxPro Driver,Data Source Name:aaa,Description空,Database type 选(.DBC),path:选定数据表为D:\mtt.dbf
然后通过sqlserver的Import Data...升迁。
Source:Microsoft Visual Foxpro Driver
User/System Dsn:aaa,
username,Password都是空,
点击下一步时报错:未指定的错误
什么原因?

解决方案 »

  1.   

    选择select by alias name 下一步会出错:
    .....File D:\mtt.dbf not a database
      

  2.   

    创建alias时,连接时出现错误:Invalid configuration parameter.
    参数是:Database Alias:ccc;Drive type :MIcrosoft Visual foxpro ;Database: D:\mtt.dbf;Open mode:read/write;SCHEMA CACHE:8(默认);SQLPASSTHRU:SHARED AUTOCOMMIT(默认)
    不知道错在哪里?
      

  3.   

    其中adotable1指向VF,adotable2指向SQL SERVER 
    adotable1.first;
    while not adotable1.eof do
      begin
       if adotable1.FieldByName('cc1').asstring<>'' then
         begin
          adotable2.Append;
          adotable2.FieldByName('cinvm_unit').asstring:=adotable1.fieldbyname('cc1').asstring;
          adotable2.FieldByName('cinvcode').asstring:=adotable1.fieldbyname('bo1').asstring;
          adotable2.fieldbyname('cinvaddcode').asstring:=adotable1.fieldbyname('bo1').asstring;
          adotable2.FieldByName('cinvname').asstring:=adotable1.fieldbyname('bo2').asstring;
          adotable2.FieldByName('cInvCCode').asstring:=copy(adotable1.fieldbyname('bo1').asstring,1,6);
          adotable2.fieldbyname('iInvSCost').ascurrency:=adotable1.fieldbyname('cc3').ascurrency;
          adotable2.FieldByName('bSale').asboolean:=true;
         adotable2.FieldByName('bPurchase').asboolean:=true;
         adotable2.FieldByName('bSelf').asboolean:=true;
         adotable2.FieldByName('bComsume').asboolean:=true;
         adotable2.FieldByName('bProducing').asboolean:=true;
         adotable2.FieldByName('bService').asboolean:=true;
         adotable2.FieldByName('bAccessary').asboolean:=true;
         adotable2.fieldbyname('dSDate').asdatetime:=date;
         adotable2.post;
        end;
        adotable1.next;
      

  4.   

    对于.dbf文件不管你怎么做都会有表导不完整(看记录有多少了,但好像又不是这个原因,也可能是Ansi Character到Unicode有问题)? 用ODBC跟本就不能成功,几乎试尽了我所有方法终于让我找到了一种办法
    1.只能先用 Excel找开然后另存成 .xls文件(字符字段全变成了255!可怕)
    2.建立ODBC别名,可惜一次只能一个文件
    4.建立BDE别名,指定 foxpro 那个(实际上是ODBC),然后在ODBC DSN中输入新建的ODBC别名
    5.打开Datadump,怎么作你看看就知
    6.导入后再改字段信息