GetRows Method
Recordset Object
METHOD: Recordset::GetString
string =
recordsetobject.
GetString
(
StringFormat, NumRows, ColumnDelimiter, RowDelimiter, NullExpr
)
The
GetString
method returns a specified
Recordset
object as a string. This method is very useful for populating tables using HTML in an ASP file or for populating text boxes using Visual Basic.
In comparison, the similar
GetRows
method returns a variant that is a two-dimensional array containing selected records from a
Recordset
object.
You cannot use this string to reopen the
Recordset
.
There are five optional parameters.
The optional
StringFormat
parameter is one of the
StringFormatEnum
constants that define the format to be used when converting the
Recordset
object to a string.
StringFormatEnum Constants
Note as of ADO version 2.5, there is only one value is this table.
Constant
Value
Description
adClipString
2
Default, delimits columns using the
ColumnDelimiter
parameter, delimits rows using the
RowDelimiter
parameter, sets a substitute for Null using the
NullExpr
parameter
The optional
NumRows
parameter is a long value that specifies how many records in the
Recordset
to convert to a string. If left blank, the default is to do all of the records. If
NumRows
exceeds the actual number of available records, only the actual number will be returned and no error will be generated.
The optional
ColumnDelimiter
parameter is a delimiter character used to space columns for ease of viewing and appearance. The default is the TAB character. To use this parameter, the
StringFormat
parameter must be set to
adClipString
.
The optional
RowDelimiter
parameter is a delimiter character used to space rows for ease of viewing and appearance. The default is the CARRIAGE RETURN character. To use this parameter, the
StringFormat
parameter must be set to
adClipString
.
The optional
NullExpr
parameter is an expression to use in place of Null. The default is the empty string "". To use this parameter, the
StringFormat
parameter must be set to
adClipString
.
Code (VBScript):
strGetString = objRecordset.
GetString
(adClipString, intNumRows, , , "Null Entry")
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information