Partilhar via


GetRangeString Method

Esse recurso será removido em uma versão futura do Microsoft SQL Server. Evite usar esse recurso em desenvolvimentos novos e planeje modificar os aplicativos que atualmente o utilizam.

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

Sintaxe

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 Distributed Management Objects (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);
ObservaçãoObservação

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.

Comentários

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.

Applies To: