short ExportEx(long QueryID, BSTR FileName, long FirstRow, long FirstCol, long LastRow, long LastCol, Boolean IncludeColHeadings, Boolean UpdateSchemaINI, short DateTimeFormat, BSTR NullValueString, BSTR ColumnSeparator, BSTR Delimiter, short DelimitOption, Boolean DelimitColHeadings, Boolean DelimitCharacterValues, Boolean DelimitNumericValues, Boolean DelimitDateTimeValues)
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() or InitializeStaticQuery(). |
FileName | A string containing the name of the file to which you want to write the export. |
FirstRow | The first row that you want to include in the export. |
FirstCol | The first column that you want to include in the export. |
LastRow | The last row that you want to include in the export, or a negative one (-1) if all rows are included. |
LastCol | The last column that you want to include in the export, or a negative one (-1) if all columns are included. |
IncludeColHeadings | Use non-zero to include the column headings in the first row and zero to exclude the column headings. |
UpdateSchemaINI | Use non-zero to update the schema.ini file used by the Microsoft ODBC text driver to convey additional data type information about the exported file. Use zero to not update the file. |
DateTimeFormat |
Optionally, the format to use for date and time values. Valid values are:
|
NullValueString | The string QMF for Windows uses to display null values that are retrieved from the database server. |
ColumnSeparator | The string used to separate columns. |
Delimiter | The string used to delimit values. |
DelimitColHeadings | Non-zero specifies that the column headings are delimited. Zero specifies that the column headings are not delimited. |
DelimitCharacterValues | Non-zero specifies that the character values are delimited. Zero specifies that the character values are not delimited. |
DelimitNumericValues | Non-zero specifies that the numeric values are delimited. Zero specifies that the numeric values are not delimited. |
DelimitDateTimeValues | Non-zero specifies that the date time values are delimited. Zero specifies that the date time values are not delimited. |
DelimitOption |
Specifies when delimiters should be used to separate values. Choose one of the following:
|
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(), GetLastErrorType(), GetLastSQLCode(), GetLastSQLError(), or GetLastSQLState() 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 table is created.