由于工作需要,我用visual foxpro6.0建了一个数据表,用ADOconnection建立连接,我选择build后出现“选择您希望连接的数据”提示,下面是ole db提供程序,我不知道选择哪一个,及以后怎么操作,请大虾们帮帮我。

解决方案 »

  1.   

    Provider=MSDASQL.1;Extended Properties="Driver={Microsoft Visual Foxpro Driver};SourceType=DBF;SourceDB='your work path'"; 
      

  2.   

    create view kk as
    select * from openrowset('MSDASQL',
    'Driver=Microsoft Visual FoxPro Driver;
    SourceDB=d:\tempbase;
    SourceType=DBF',
    'select * from xsd1 ')
      

  3.   

    Provider=MSDASQL.1;Connect Timeout=15;Extended Properties="DefaultDir=D:\Examples\ADO\通过ADO使用本地数据表\Sourse;Deleted=1;Driver={Microsoft dBase Driver (*.dbf)};DriverId=533;FIL=dBase 5.0;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=600;SafeTransactions=0;Statistics=0;Threads=3;UID=admin;UserCommitSync=Yes;";Locale Identifier=2052
      

  4.   

    你好天痴:您的基本要成功了,但是我用adotable连接学生学籍时却出现错误,我改变您的语句后是这样的:
    [oledb]
    ; Everything after this line is an OLE DB initstring
    Provider=MSDASQL.1;Connect Timeout=15;Extended Properties="DefaultDir=D:\政教处管理系统\data;Deleted=1;Driver={Microsoft dBase Driver (*.dbf)};DriverId=533;FIL=dBase 5.0;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=600;SafeTransactions=0;Statistics=0;Threads=3;UID=admin;UserCommitSync=Yes;";Locale Identifier=2052
    用adotable连接其下面的一个学生学籍.dbf后,打开
    在设计期使adotable1.active:=true;没有问题
    但是只要一运行,就出现这样的错误:
    Project Project1.exe raised exception class EVariantError with message 'Invalid variant type conversion'.Process stopped.Use Step or Run to continue
    请问该怎么办,先行谢谢了
      

  5.   

    你的方法是通过odbc来联的(ODBC有时会出些莫名的错),其实ado连接fox的dbf可用dbase 5.0的引擎:
    Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=D:\政教处管理系统\data;Extended Properties=dbase 5.0;Persist Security Info=True
    我一直用它,没问题的
      

  6.   

    你好keiy(),您的办法已经成功,现在又出现了一个问题,我添加了一个dbgrid,点开始事务,然后修改里面的内容,然后回滚,可是不管用,这是咋回事,先谢谢了
      

  7.   

    foxpro6.0的自由表是没有事物概念的,自然不能回滚了
    当然如果你建立一个FOX数据库就可以了