Data objects represent the data access tier of your application. They are responsible for the accuracy, completeness, and consistency of the data they own. They should work correctly whether or not their clients are transactional. Data objects for MTS are in-process COM components, preferably supporting the apartment threading model. They should call the ObjectContext, SetComplete, and SetAbort methods as often as possible to help MTS reclaim server resources when the objects are not actively used. Data objects should connect to data sources using a fixed identify so that they can take advantage of connection pooling provided by MTS.
Most COM programming tools can create skeleton implementations of data objects automatically, thereby letting developers focus on implementing their interface methods. The preferred method for data access within data objects is using ADO. The three most commonly used techniques for accessing data through ADO are the Connection Execute method, Command objects, and Recordset objects. The Connection Execute method should be reserved for simple, nonparameterized queries since it returns a read-only, forward-only Recordset. Command objects can be used for simple parameterized queries. The most flexibility is offered by using Recordset. Disconnected Recordset objects let you pass data back to clients without maintaining a connection to the underlying data source.