Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
Exporting a Query... |
Sun, Feb 28 2021 8:12 PM | Permanent Link |
Ian Branch | Hi Team,
D10.4.2, current EDB. I have the following code.. {code} ... .. // ExportQuery.Export('DBiWStatsExport.csv', 'Exports', , , , , , , , , , , , , True); // ExportQuery.Close; // ... .... {code} I only want to define the file name, Store & Include File Headers. Unfortunately Delphi doesn't like it as is. I can add some elements.. {code} // ExportQuery.Export('DBiWStatsExport.csv', 'Exports', nil, ffDelimited, feAuto, , , , , , , , , , True, -1); // {code} I would have thought that there was no need to fill in the blanks as they should default?? If I fill in the blanks.. {code} // ExportQuery.Export('DBiWStatsExport.csv', 'Exports', nil, ffDelimited, feAuto,SEPARATOR, DOUBLE_QUOTE, ANSI_DATE_FORMAT, ANSI_TIME_FORMAT, ANSI_12HOUR_AM, ANSI_12HOUR_PM, ANSI_DECIMAL_SEPARATOR, ANSI_TRUE, ANSI_FALSE, True, -1); // {code} and have edbcomps in my Uses.. I still get issues with these - SEPARATOR, DOUBLE_QUOTE, ANSI_DATE_FORMAT, ANSI_TIME_FORMAT, ANSI_12HOUR_AM, ANSI_12HOUR_PM, ANSI_DECIMAL_SEPARATOR, ANSI_TRUE, ANSI_FALSE. I can't find where they are actually defined. Help... Regards & TIA, Ian |
Mon, Mar 1 2021 3:07 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
Never having used that I can only try to answer some of your questions. The function is in edbcomps which in my case is located in C:\D2007Ex\ElevateDB\code\source The constants SEPARATOR, DOUBLE_QUOTE etc MIGHT be in edbstring - look at the uses clause in edbcomps for other possibles As far as defaults are concerned I have no idea what the official line is but once I've overridden one I supply values for the following ones. Roy Lambert |
Mon, Mar 1 2021 9:53 AM | Permanent Link |
Raul Team Elevate | On 2/28/2021 8:12 PM, Ian Branch wrote:
> I only want to define the file name, Store & Include File Headers. > Unfortunately Delphi doesn't like it as is. That's not how Delphi works. > I would have thought that there was no need to fill in the blanks as they should default?? Unfortunately defaults are used only if they are not present - there is no such thing in delphi as "use default" parameter once you supplyanything. > ExportQuery.Export('DBiWStatsExport.csv', 'Exports', nil, ffDelimited, feAuto,SEPARATOR, DOUBLE_QUOTE, ANSI_DATE_FORMAT, ANSI_TIME_FORMAT, ANSI_12HOUR_AM, ANSI_12HOUR_PM, ANSI_DECIMAL_SEPARATOR, ANSI_TRUE, ANSI_FALSE, True, -1); > // > {code} > and have edbcomps in my Uses.. > I still get issues with these - SEPARATOR, DOUBLE_QUOTE, ANSI_DATE_FORMAT, ANSI_TIME_FORMAT, ANSI_12HOUR_AM, ANSI_12HOUR_PM, ANSI_DECIMAL_SEPARATOR, ANSI_TRUE, ANSI_FALSE. Those are in edbstring so make sure your uses includes "edbcomps, edbstring" if you use this a lot and to keep code clean you could add a class helper (this is in your code) i.e. type TEDBQueryHelper = class helper for TEDBQuery public procedure ExportSimple( const ExportFile:string; const StoreName: String; IncludeHeaders: Boolean); end; implement as procedure TEDBQueryHelper.ExportSimple(const ExportFile: string; const StoreName: String; IncludeHeaders: Boolean); begin Export( ExportFile, StoreName, nil, ffDelimited, feAuto, SEPARATOR, DOUBLE_QUOTE, ANSI_DATE_FORMAT, ANSI_TIME_FORMAT, ANSI_12HOUR_AM, ANSI_12HOUR_PM, ANSI_DECIMAL_SEPARATOR, ANSI_TRUE, ANSI_FALSE, IncludeHeaders); end; and then you call it like this using existing code ExportQuery.ExportSimple('DBiWStatsExport.csv', 'Exports',True); Raul |
Mon, Mar 1 2021 5:10 PM | Permanent Link |
Ian Branch | Tks Raul,
All good now. No wonder I couldn't find it. There is no edbstring.pas file. Regards, Ian |
This web page was last updated on Friday, March 29, 2024 at 03:30 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |