Autor Beitrag
ak
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 240

Suse Windows 9 XP
D6 Professional
BeitragVerfasst: Fr 27.06.03 15:46 
Hallo Leute,

wie kann ich die Daten aus einer SQL Abfrage die ich in einem String gespeichert habe in eine Excel Tabelle einfügen (am besten auch einer Excelspalte zufügen)?
Dazu habe ich folgenden Code vorbereitet:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
query2.SQL.Clear;
query2.SQL.Add('select Artikel, Preis from Artikelliste ');
query2.Active:=True;
query2.First;

for i:=0 to query2.RecordCount-1 do begin

  s1:= query2.Fieldbyname('Artikel').AsString; 
  s2:= query2.Fieldbyname('Preis').AsString; 
  query2.Next;

end;

wie kann ich jetzt die beiden strings (s1,s2) in eine Exceltabelle einfügen?

Gruß AK

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Fr 27.06.03 16:57 
Hi!

Ich glaube nicht, daß du der Erste bist, der dies wissen möchte...

Darum gebe ich dir nur diese Antwort:

www.delphi-forum.de/search.php

und nach Excel suchen.
ak Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 240

Suse Windows 9 XP
D6 Professional
BeitragVerfasst: Sa 28.06.03 08:47 
danke, ich werds mir mal anschauen, bin zur Zeit aber etwas in Zeitnot...

Gruß AK
ak Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 240

Suse Windows 9 XP
D6 Professional
BeitragVerfasst: So 29.06.03 12:20 
Eine Lösung wäre auch einfach die Strings mit einem ";" trennen und dann in einer .csv Datei abspeichern. Das Kann Excel dann in einer Tabelle darstellen, dannach kann es in Excel als .XLS Datei gespeichert werden.

Gruß AK