CopyToClipboard()


" "

short CopyToClipboard(long QueryID, long FirstRow, long FirstCol, 
long LastRow, long LastCol, BOOLEAN IncludeColHeadings, [VARIANT DateTimeFormat])

Description

This function copies the specified range of rows and columns to the clipboard. If you have not retrieved row data for all of the rows that you want to copy to the clipboard, call CompleteQuery() prior to calling this function. An error message will be returned if you attempt to copy 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 copy. The value of the first row in a result set is 0.
FirstCol The first column that you want to include in the copy. The value of the first column in a result set is 0.
LastRow The last row that you want to include in the copy, or a negative one (-1) if all rows are included. The value of the 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 copy, or a negative one (-1) if all columns are included. The value of the 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 not include them.
DateTimeFormat

Optionally, the format to use for date and time values. Valid values are:

0 -- ISO format
1 -- USA format
2 -- EUR format
3 -- JIS format
4 -- Windows Control Panel format. The default value is 4.

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 negative one. In this case, zero is returned and an empty string is copied to the clipboard.

Related Tasks

ExecuteEx()
Export()