Working with Queries Views

Since ADO is part of Microsoft's UDA strategy, it was felt that the term query failed to adequately describe the mechanism for retrieving data from a source that could be almost anything. As described earlier, ADO can retrieve data from many different sources, not just the Jet database engine, so the term view was adopted in ADO to more accurately describe a view, or perspective, of the data, regardless of where it came from.

To simplify things while working with the Jet database engine, Microsoft has maintained the existing terminology by referring to them externally as queries; however, this nomenclature changes to views when working with external data sources such as the SQL Server.

If this seems a little confusing, don't worry. Just remember that ADO is a different object model that simply refers to the same objects in a different way, and by (sometimes) different names. When working with queries, just replace the DAO-specific keywords query and QueryDef with the new ADO keyword view. That's all you need to do.

Whenever you work with other data access objects, such as Recordset and Command objects, you can also use a View object to specify the SQL operation that should be used. Exactly how you do that is explained in the relevant sections on Recordset and Command objects.

As with DAO QueryDefs, you can also build ADO views in code.

0 0

Post a comment