GetRangeString Method

SQL-DMO

SQL-DMO

GetRangeString Method

The GetRangeString method returns a single string that contains a block of rows and columns from the current result set of the QueryResults object.

Applies To
QueryResults Object
Syntax

object.GetRangeString( [ Top ] , [ Left ] , [ Bottom ] , [ Right ] ,
[ RowDelimiter ] , [ ColDelimiter ] , [ ColWidths ] ) as String

Parts

object

Expression that evaluates to an object in the Applies To list.

Top

Optional. Long integer that specifies a starting row in the result set. When no value is specified, the first row in the returned string is formed from the names of columns in the result set.

Left

Optional. Long integer that specifies a starting column in the result set. When no value is specified, the first column marks the left of the extracted range.

Bottom

Optional. Long integer that specifies an ending row in the result set. When no value is specified, the last row marks the bottom of the extracted range.

Right

Optional. Long integer that specifies an ending column in the result set. When no value is specified, the last column marks the right of the extracted range.

RowDelimiter

Optional. String used to delimit rows. When no value is specified, rows are delimited using a carriage return/line feed sequence.

ColDelimiter

Optional. String used to delimit columns. When no value is specified, columns are delimited using a tab character regardless of the setting of the ColWidths argument.

ColWidths

Optional. SQL-DMO multistring of integer values that specifies fixed widths for value representation in the string. If no value is specified in the ColDelimiter argument, data is represented in the string at fixed width and with the default tab delimiter.

Prototype (C/C++)

HRESULT GetRangeString(
SQLDMO_LPBSTR pRetVal,
long Top = 0,
long Left = 0,
long Bottom = -1,
long Right = -1,
SQLDMO_LPCSTR RowDelim = NULL,
SQLDMO_LPCSTR ColDelim = NULL,
SQLDMO_LPCSTR ColWidths = NULL);

Note  SQL-DMO strings are always returned as OLE BSTR objects. A C/C++ application obtains a reference to the string. The application must release the reference using SysFreeString.

Returns

A string

Remarks

When no optional arguments are specified, the GetRangeString method returns a string representation of the entire result set. The first line of text returned contains result set column names. The second line contains hyphen character strings underlining the column names.

For more information about setting multistring parameters, see Using SQL-DMO Multistrings.