short Export(long QueryID, long FirstRow, long FirstCol, long LastRow, long LastCol, short Format, short StringDelimiter, short ColumnDelimiter, Boolean IncludeColHeadings, BSTR FileName, [VARIANT DateTimeFormat])
Description
This function exports the specified range of rows and columns using the selected options to the targeted file. Call CompleteQuery() prior to calling this function if you have not retrieved row data for the rows that you want to export. An error message is returned if you attempt to export rows that have not been retrieved from the database.
Parameters
Name | Description |
---|---|
QueryID | The ID of the query, as returned from InitializeQuery(). |
FirstRow | The first row that you want to include in the export. The value of a first row in a result set is 0. |
FirstCol | The first column that you want to include in the export. The value of the first column in a result set is 0. |
LastRow | The last row that you want to include in the export, or a negative one (-1) if all rows are included. The value of the actual last row in a result set is one less than the total number of rows. |
LastCol | The last column that you want to include in the export, or a negative one (-1) if all columns are included. The value of the actual last column in a result set is one less than the total number of columns. |
IncludeColHeadings | Use non-zero to include the column headings in the first row and zero to exclude them. |
FileName | A string containing the name of the file to which you want to write the export. |
DateTimeFormat |
Optionally, the format to use for date and time values. Valid values are:
|
Format |
Use one of the following to specify output format:
|
StringDelimiter |
Use one of the following to specify the string delimiter. This parameter is ignored if Format is RSEF_HTML:
|
ColumnDelimiter |
Use one of the following to specify the column delimiter. This parameter is ignored if Format is RSEF_HTML:
|
Return Value
The return value will be zero if successful or non-zero if unsuccessful. If the return value is non-zero, you can call GetLastErrorString() or GetLastErrorType() to get additional error information. If the result set is empty or no rows have been retrieved from the database, non-zero is returned unless FirstRow equals 0 and LastRow equals -1 In this case, zero is returned and an empty file is written.
Related Tasks