23. April 2009 09:56
strSQL := 'SELECT CStr([Artikel_Nr]) AS Art_Nr, CStr([Artikel_Nr_Kunde]) AS ArtNrKd,';
strSQL := strSQL + ' CStr([Bezeichnung1]) AS Bez1, CStr([Bezeichnung2]) AS Bez2,';
strSQL := strSQL + ' CStr([Bezeichnung3]) AS Bez3, CStr([Farbe]) AS Color,';
strSQL := strSQL + ' CStr([Zusatztext]) AS Zusatz, CStr([EAN_Code]) AS EAN, CStr([Etikettenbeschreibung]) AS Etikett';
strSQL := strSQL + ' FROM ' + parTabName;
IF NOT FILE.EXISTS(FileName) THEN
F1.CREATE(FileName);
F1.WRITEMODE(TRUE);
F1.TEXTMODE(TRUE);
F1.OPEN(FileName);
.....
CLEAR(Line);
//Erste Exportzeile: Überschriften
IF FehlerZaehler = 0 THEN BEGIN
FOR i := 0 TO (ADOrs.Fields.Count - 1) DO BEGIN
Line := Line + ADOrs.Fields.Item(i).Name;
IF i < (ADOrs.Fields.Count - 1) THEN
Line := Line + ';'
END;
F1.WRITE(Line);
END;
//Datenzeilen
Line := '';
FOR i := 0 TO (ADOrs.Fields.Count - 1) DO BEGIN
FLD_str := ADOrs.Fields.Item(i).Value;
Line := Line + FLD_str;
IF i < (ADOrs.Fields.Count - 1) THEN
Line := Line + ';'
END;
F1.WRITE(Line);
FehlerZaehler := FehlerZaehler + 1;
END;
23. April 2009 10:19
Ansi2Ascii(_String : Text[250]) _Output : Text[250]
// Converts from ANSI to ASCII
EXIT(CONVERTSTR(_String,'óÚÔõÓÕþÛÙÞ´¯ý’µã¶÷ž¹¨ Íœ°úÏÎâßݾ·±Ð¬‡Š«Œ‹“”‘–—¤•ËÈÊš›™',
'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÂÀÊËÈÍÎÏÌÓßÔÒÚÛÙ'));
Ascii2Ansi(_String : Text[1024]) : Text[1024]
// Converts from ASCII to ANSI
EXIT(CONVERTSTR(_String,'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÂÀÊËÈÍÎÏÌÓßÔÒÚÛÙ',
'óÚÔõÓÕþÛÙÞ´¯ý’µã¶÷ž¹¨ Íœ°úÏÎâßݾ·±Ð¬‡Š«Œ‹“”‘–—¤•ËÈÊš›™'));
23. April 2009 11:56