如何导出DBISAM数据库文件

解决方案 »

  1.   

    var
       OutgoingFields: TStrings;
    begin
       OutgoingFields:=TStringList.Create;
       try
          with MyDBISAMTable do
             begin
             DatabaseName:='d:\temp';
             TableName:='customer';
             if Exists then
                begin
                Open;
                try
                   Filter:='EMail IS NOT NULL';//EMail字段名
                   Filtered:=True;
                   with OutgoingFields do
                      begin
                      Add('CustomerName');
                      Add('ContactName');
                      Add('Phone');
                      Add('Fax');
                      Add('Email');
                      end;
                   ExportTable('d:\temp\outgoing\customer.txt',',',False,OutgoingFields);
                   { Date, time, and number formatting left to defaults for example purposes }
                finally
                   Close;
                end;
                end;
             end;
       finally
          OutgoingFields.Free;
       end;
    end;