GetRangeString Method (SQL-DMO)

The GetRangeString method returns a single string containing 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

Part Description
object Expression that evaluates to an object in the Applies To list.
Top Optional. Long integer specifying 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 specifying 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 specifying 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 specifying 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 by using a carriage return/line feed sequence.
ColDelimiter Optional. String used to delimit columns. When no value is specified, columns are delimited by using a tab character regardless of the setting of the ColWidths argument.
ColWidths Optional. SQL-DMO multistring of integer values specifying 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.

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.

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 by using SysFreeString.


  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.