xmlGetXMLFromRSEx (server-side)

Use this routine to create an XML document element and populate it with record elements corresponding to some or all of the records in the specified ActiveX Data Object (ADO) Recordset object.

This conversion process results in an XML XMLDOMElement object containing the standard XML data record format.

Definition

xmlGetXMLFromRSEx(rsQuery,

                  nStartRecord,

                  nPageSize,

                  nExRecordCount,

                  dFormats)

Parameters

rsQuery

An ADO Recordset object, from which the records to be converted are retrieved.

nStartRecord

A number specifying the position in the recordset of the first record to be converted. Positions are counted from 0 (zero). A value of –1 causes this parameter to be ignored, which has the same effect as passing a value of 0 (zero).

nPageSize

A number specifying the number of consecutive records to convert. A value of –1 causes all records in the recordset to be converted.

nExRecordCount

A number specifying a record count to override the count from the recordset. A value of –1 causes this parameter to be ignored, resulting in the record count from the Recordset object being used. Pass a value of 'TOO_BIG_TOO_COUNT' when the number of records makes it unreasonable to count them all.

dFormats

A Dictionary object that contains information used for special date/time mapping between ADO date/time formats and Commerce Server Business Desk date/time formats.

Return Value

An XML XMLDOMElement object containing record elements that mirror all or part of the data in the specified ADO Recordset object.

Remarks

The conversion results in all or part of the data in the specified ADO recordset being represented as an XML document element (an XMLDOMElement object) containing a number of record elements (more XMLDOMElement objects).

The dFormats parameter specifies a Dictionary object that is used to do special date and time related format mapping. The keys in this Dictionary object are the names of fields, and the values are either ActiveX Data Object (ADO) data type values, or a special value corresponding to the constant COMMERCE_SPLIT_DATE. Field names are looked up in this Dictionary object to determine the proper value to pass as the sType parameter of the routine AddFormattedNode. The following table shows these mappings.

Dictionary Value for Field Name Key sType Value and Processing
AD_DATE, AD_DB_DATE, AD_DB_TIMESTAMP, AD_DB_TIME sType parameter set to corresponding Dictionary object value.
COMMERCE_SPLIT_DATE Two calls to the AddFormattedNode routine are made with the following parameters:
  1. sName = <ADOfield name>_date
    sValue = <ADOfield value>
    sType = AD_DB_DATE

  2. sName = <ADOfield name>_time
    sValue = <ADOfield value>
    sType = AD_DB_TIME
All others. sType parameter set to corresponding ADO Field type property.

This routine is available in the include file DBUtil.asp.

See Also

Server-Side Routines

xmlGetXMLFromQuery (server-side)

xmlGetXMLFromQueryEx (server-side)

xmlGetXMLFromRS (server-side)

Client-Side Routines


All rights reserved.