Introduction
ATK uses the data views and instance formats that you define in Inspector and store in the metaknowledge. In this chapter
This chapter presents the following topics:
ATK provides read and write access, by means of the ATK ActiveX server or the ATK OLE DB provider, to data views you define in the Inspector. To do this, ATK must process the ObjectStore database's metaknowledge, which Inspector stores.
ATK must be able to access the Inspector metaknowledge. When you install ATK, the installation program verifies that the Inspector is installed, examines the Inspector configuration to determine where the metaknowledge resides, and configures ATK with that location. Thus, ATK can access the data views and instance formats you define using Inspector.
To modify the ATK configuration, refer to Chapter 4, Configuring ATK.
Accessing Data Views and Instance Formats from ATK
What is a data view?
A data view is a tabular representation of a persistent ObjectStore collection that uses a specified instance format to display persistent instances. You can define a data view based on any of the following:
For example, suppose the class Customer has two data members, name and address. You can use Inspector to build a data view based on a collection of customers. A data view's instance format specifies the set of data members that must be displayed for an instance of the class in the data view. If you are displaying a table of instances, the instance format specifies what columns have to be displayed. This simple data view has an instance format of two columns that represent the name and address of each Customer object contained in the persistent collection.
Accessing Data Views from ATK
To access a data view defined in Inspector, use the ATK ActiveX server or ATK OLE DB provider and specify the name of the data view.
atkDataView = atkDatabase.GetDataView("my_first_dataview")Using the ATK OLE DB provider, open a record set representing the same data view:
adoRecordSet.Open("my_first_dataview", adoConnection)You can also use SQL statements with OLE DB:
adoRecordSet.Open("SELECT * FROM my_first_dataview", adoConnection)Note that if you use SQL statements, the data view name must follow SQL syntax rules.
When you create a data view in Inspector, you can save the data view template with a symbolic name. When you modify an instance format in Inspector, you usually modify the default instance formats associated with each class. However, the Inspector will save any modification to the template instance format using the symbolic name. The ATK ActiveX server accesses this name and displays data according to the specified instance format.
Refer to Chapter 2, Accessing ATK ActiveX Server from ASP Applications, in the ObjectStore Active Toolkit Tutorial, for an example of defining multiple instance formats for a specific class and accessing them from the ATK ActiveX server, and customizing a data view using the ATK ActiveX server or ATK OLE DB provider.
Updated: 05/11/99 11:33:45