Autor Beitrag
mi-frank
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 21.11.05 11:58 
Hallo,

wie kann ich die Anzahl der Felder die in meiner TTable sind ermitteln und dann gleichzeitig den Inhalt in eine CSV-Datei schreiben!

Hab schon mal ein bißchen herumexperimentiert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
    AssignFile(f, Temp + '\Serienbrief.csv');
    try
     if FileExists(Temp + '\Serienbrief.csv') = False then
      Rewrite(f)
     else begin
      DeleteFile(Temp + '\Serienbrief.csv');
      Rewrite(f);
     end;
     Anzahl := PersonDM.BriefeTB.Count-1;
     //Array wird in die CSV-Datei geschrieben
     for zaehler:= 0 to Anzahl do
      begin
       if Datensatz = '' then
         Datensatz := PersonDM.BriefeTB.Fields[zaehler].AsString
       else
         Datensatz := Datensatz + ', ' + PersonDM.BriefeTB.Fields[zaehler].AsString;
      end;
    //Writeln(f, OwnerDs.DataSet.Fields[0].Value);
      Writeln(f, Datensatz );
    finally
     CloseFile(f);
    end;


Ich bedanke mich schon im voraus für jede Hilfe!!

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
cartridge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 209

Win XP
D4 Prof,D6 Prof
BeitragVerfasst: Mo 21.11.05 20:25 
Siehe Online- Hilfe unter "FieldCount"

GHruß Ingo
mi-frank Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 21.11.05 22:47 
Danke!!