The Datasource Object

Note

The Datasource object is included in Commerce Server 3.0 only for backward compatibility with sites created in Commerce Server 2.0. New sites should be constructed using Microsoft® ActiveX® Data Objects (ADO).

The Datasource object executes queries against a system or file data source name (DSN), and where appropriate, returns query results in a SimpleList object containing Dictionary objects, or in an ADO Recordset object. The queries that you execute can be SQL statements declared as string variables in the page in which you execute the query, or query variables cached in a Content object.

You do not use the Active Server Pages (ASP) Server object’s CreateObject method to create a Datasource object. Instead, you use the Content object’s Datasource method, which creates the object based on the DSN variable that is cached by the Content Object. Once you have created a Datasource object, the Datasource has access to the Content object’s cache of queries.

The Datasource object supports the following methods.

Method Description
CreateADOConnection Returns a read-only Connection object. You can pass this object as a parameter to ExecuteADO.
Execute Executes the specified query against a data source, and where appropriate, returns the results in a SimpleList object containing Dictionary objects.
ExecuteADO Executes the specified query on an open ADO Connection, and where appropriate, returns the results in an ADO Recordset object.


© 1997-1998 Microsoft Corporation. All rights reserved.