Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 11 to 11 of 11 total |
Script help needed please.. |
Thu, Sep 27 2018 11:58 PM | Permanent Link |
Ian Branch | If anybody is interested, this is the code I used to export the Query (tqParts).
{code} procedure TMainForm.Button1Click(Sender: TObject); var Stream: TFileStream; i, iCount: Integer; OutLine: Ansistring; sTemp: Ansistring; begin // iCount := 0; // tqParts.Open; // Stream := TFileStream.Create('.\MYOBPartsExport.txt', fmCreate); // try while not tqParts.Eof do begin // You'll need to add your special handling here where OutLine is built OutLine := ''; for i := 0 to tqParts.FieldCount - 1 do begin sTemp := tqParts.Fields[i].AsString; // Special handling to sTemp here sTemp := StringReplace(sTemp, ',', '-', [rfReplaceAll, rfIgnoreCase]); // OutLine := OutLine + sTemp + ','; end; // Remove final unnecessary ',' SetLength(OutLine, Length(OutLine) - 1); // Write line to file Stream.Write(OutLine[1], Length(OutLine) * SizeOf(AnsiChar)); // Write line ending Stream.Write(sLineBreak, Length(sLineBreak)); Inc(iCount); tqParts.Next; end; finally Stream.Free; // Saves the file end; // tqParts.Close; // Panel2.Caption := 'Processing Completed..'; // end; {code |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |