# Subordinate Objects

DataSource |

DataSource is a subordinate object used to define the primary data source for the view or data sources defined in relationships. It will create groups of DS_Item and DS_Link objects to do this. The main DataSource object corresponds to a record in the pvxview.src file.

For information on the pvxview.src file structure, see Views System File Structures. Properties are read only and are set using corresponding Setxxx( ) methods.

## DataSource Properties

The following table lists the properties of the DataSource subordinate object:

Property | Description
Description$ | Data source name - short description of data source (used to identify the data source).
Expression_Ind$ | Expression indicator for PrimarySource$. "=" denotes PrimarySource$ contains an expression to be evaluated. A blank indicates that the value of PrimarySource$ is a fixed value (Default).
InternalID$ | Internal identifier for the data source.
InitLogicType$ | Single character string indicating logic type:
C | Call
X | Execute
I or blank | Ignore (Default)
InitLogic$ | Logic to be executed when a data source object is established. Reference based on InitLogicType$. If type C, InitLogic$ contains program; entrypoint. If type X, InitLogic$ contains PxPlus statement(s) to be executed. String, 128 characters. See Logic Procedures.
CloseLogicType$ | Same as for InitLogicType$.
CloseLogic$ | Logic to be executed when a data source object is dropped. See Logic Procedures.
LongDescription$ | Long description for storing notes about the data source.
LogicObject$ | Object specified to supply logic references. See Logic Procedures.
PrimarySource$ | Primary data source, contents of this property vary according to SourceType$: Logical file name (L), File name (P), Object name;tableID (O), or External database table connection string (T).
SourceType$ | Source type indicator:
L | PxPlus file identified by logical name.
P | PxPlus file identified by path name or prefix file reference to an external database table (PxPlus SQL ODBC Driver, ADO, Oracle, MySQL or DB2).
O | Custom data source object.
T | External database table.
D | Disabled source.
Src | Object identifier to the data source driver associated with the data source (e.g. *views/logio, *views/fileio or any custom data source object).
UpdateStamp$ | Last update.
The following items are object Groups (*obj/group) that define a list of related objects:
DS_Item | Standard group of DS_Item objects. One object for each item defined in the data source.
DS_Link | Standard group list of DS_Link objects. One object for each link used by the DataSource.

## DataSource Methods

The following table lists the methods of the DataSource subordinate object:

Method | Description
AddItem([ColumnName$ | " * " ]) | (Internal Use Only) Create a new DS_Item object. If a column name (no trailing "$") is supplied, the item object is initialized with information derived from the data source driver. If an *asterisk is supplied, all columns in the source will be added. Use ViewCtl equivalent.
AddLink( ) | (Internal Use Only) Create a new DS_Link object. Use ViewCtl equivalent.
Clear( ) | Re-initialize the data source object and delete all subordinate objects.
ClearItems( ) | (Internal Use Only) Remove subordinate DS_Item objects.
ClearLinks( ) | (Internal Use Only) Remove subordinate DS_Link objects.
GetItem(Item$ | idx) | Return the DS_Item object handle for the specified item. If Item$ is used, the method will attempt to match it to both the item description and name.
GetItemCount( ) | Return the number of items in the data source.
GetItemIndex(Item$) | Return the DS_Item group index for the specified item. (Name or description may be used.)
GetLink(LinkDesc$ | idx) | Return the object identifier for the specified DS_Link object.
GetLinkCount( ) | Return the number of links defined for the data source.
GetLinkIndex(LinkDesc$) | Return the DS_Link group index for the specified link.
RemoveItem(Item$ | idx) | (Internal Use Only) Remove the specified DS_Item object. If Item$ is used, the method will attempt to match it to both the item description and name. Use ViewCtl equivalent.
RemoveLink(LinkDesc$ | idx) | (Internal Use Only) Remove the specified DS_Link object. Use ViewCtl equivalent.
SetCloseLogic (Type$,Logic$) | Set CloseLogic$.
SetDescription(Description$) | (Internal Use Only) Set description of data source (used to identify the data source). Use ViewCtl equivalent.
SetInitLogic(Type$,Logic$) | Set InitLogic$.
SetInternalID(InternalID$) | (Internal Use Only) Set internal identifier for the data source.
SetLogicObject(ObjNm$) | Set LogicObject$.
SetLongDescription$(LongDesc$) | Set long description for storing notes about the data source.
SetPrimarySource(SrcType$,SrcName$,Expr) | Set SourceType$ and PrimarySource$. Expr is either X or " " null.
SetUpdateStamp(Stamp$) | (Internal Use Only) Set date/time stamp of last update.