Microsoft Remote Data ServiceMicrosoft Remote Data Service*
*Contents  *Index  *Topic Contents

CreateRecordset Method

Creates an empty, disconnected ADODB.Recordset.

Syntax

object.CreateRecordset(ColumnInfos)
PartDescription
objectAn object variable that represents an RDSServer.DataFactory or RDS.DataControl object.
ColumnsInfosA Variant array of arrays defining each column in the Recordset being created. Each column definition contains an array of four required attributes:
  • Name — Name of the column header.

  • Type — Integer of data type.

  • Size — Integer of width in characters, regardless of data type.

  • Nullability — Boolean value.

The set of column arrays is then grouped into an array, which defines the Recordset.


Applies To

RDSServer.DataFactory, RDS.DataControl

Remarks

The server-side business object can populate the resulting ADODB.Recordset with data from a non-OLE DB data provider, such as an operating system file containing stock quotes.

To sort on a Recordset, any pending changes must first be saved. If you are using the RDS.DataControl, you can use the SubmitChanges method. For example, if your RDS.DataControl is named ADC1, your code would be ADC1.SubmitChanges. If you are using an ADO Recordset, you can use its UpdateBatch method. Using UpdateBatch is the recommended method for Recordset objects created with the CreateRecordset method. For example, your code could be myRS.UpdateBatch or ADC1.Recordset.UpdateBatch.

The following table lists the data types supported by the RDSServer.DataFactory object's CreateRecordset method. The number listed is the reference number used to define fields.

Each of the data types is either fixed length or variable length. Fixed length types should be defined with a size of –1, because the size is predetermined and a size definition is still required. Variable length data types allow a size from 1 to 32767.

For some of the variable data types, the type may be coerced to the type noted in the Substitution column. You won't see the substitutions until after the Recordset is created and filled. Then you can check for the actual data type, if necessary.
LengthConstantNumberSubstitution
FixedadTinyInt16
FixedadSmallInt2
FixedadInteger3
FixedadBigInt20
FixedadUnsignedTinyInt17
FixedadUnsignedSmallInt18
FixedadUnsignedInt19
FixedadUnsignedBigInt21
FixedadSingle4
FixedadDouble5
FixedadCurrency6
FixedadDecimal14
FixedadNumeric131
FixedadBoolean11
FixedadError10
FixedadGuid72
FixedadDate7
FixedadDBDate133
FixedadDBTime134
FixedadDBTimestamp1357
VariableadBSTR8130
VariableadChar129200
VariableadVarChar200
VariableadLongVarChar201200
VariableadWChar130
VariableadVarWChar202130
VariableadLongVarWChar203130
VariableadBinary128
VariableadVarBinary204
VariableadLongVarBinary205204

Example

See Also

Defining a Recordset


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.