如何把一个*.dbf表用ado访问让后导出为一个记录文件。
并且我要能够操作文件中的纪录。
请高手给出部分代码和注释。

解决方案 »

  1.   

    通过odbc连接上,然后使用数据集打开之后就随你操作了
      

  2.   

    就想  outer2000(天外流星)  说的那样最好
      

  3.   

    Saves a recordset to a file.procedure SaveToFile(const FileName: String = ''; Format: TPersistFormat = pfADTG);DescriptionCall SaveToFile to save the current recordset to a file. If the destination file already exists, it is overwritten.FileName is a string containing the name of the destination file. This file remains open from the first call to SaveToFile until the dataset is closed. This file can be read by other applications while it is open, but they cannot write to the file.Format specifies the file format for the saved recordset. By default, Format is pfADTG (Advanced Data Tablegram format).
      

  4.   

    你可以自己定义一个结构,然后读出表中数据按照定义的结构存到二进值文件中,扩展名随便取,访问的时候按照结构读出就行了。或者存到INI文件,结构如
    [Id1]
    Field1 = xxxx
    Field2 = xxxx
    ...
    [Id2]
    Id1,Id2用表的主键的值代替,Field1,Field2用字段名代替,xxxx用字段值代替
    访问时读INI文件
        TIniFile * ini = new TIniFile("tabel.ini");
        AnsiString s1,s2;
        s1 = ini->ReadString("Id1","Field1","");
        s2  = ini->ReadString("Id1","Feild2","");
        delete ini;
      

  5.   

    如果数据量大,建议存为二进制文件,因为Windows读取INI文件好象限制.