共用方式為


GetRangeString Method

未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。

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

語法

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);

[!附註]

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.

備註

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: