-
Syntax:
- string = recordsetobject.GetString
(StringFormat, NumRows, ColumnDelimiter, RowDelimiter, NullExpr)
- StringFormat
-
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.
- NumRows
-
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.
- ColumnDelimiter
-
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.
- RowDelimiter
-
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.
- NullExpr
-
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.
Returns the specified Recordset as a string.
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.
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 |
Examples
Code:
strGetString = objRecordset.GetString(adClipString,
intNumRows, , , "Null Entry")
See Also: