company logo

DataSourceHandle :: Open - Open DataSourceHandle

A Data source consists of a Dictionary and a Database. In addition a DatabaseObject and an Extent can be defined. The data source can be closed using the function Close(). If a DataSourceHandle is already opened this is closed before reopening the DataSourceHandle with the current parameters.

The data source is defined by means of external resource definitions in the DataSourceHandle (server_name, dict_path, db_path, object_name, extent_name, inst_key).

Return value:  Success ( logical  )

Implementation details

  1. Open empty data source
    logical DataSourceHandle  :: Open ( ODABAClient &client_refc, PIACC acc_mod=PI_Read )

    A data source can be opened when the application has filled the external specifications for the data source. At least the dict_path should be set in the data source before opening.

    The data source should be opened only, when all external resources to be accessed are defined in the data source. When the client is not connected the server specifications (server_name and port_number) should be set as well. This is not necessary when running a local application.

    • client_refc - Reference to client handle
    • acc_mod - Access option

      The access option defines the way instances in a property handle are to be accessed (read, update, write).

      Default: PI_Read
  2. to list
  3. Opening data source from catalog
    logical DataSourceHandle  :: Open ( ODABAClient &client_refc, NString &datasource_name )

    The function opens the data source based on external resource definitions passed stored in the data source catalog. In this case external resource definitions are read from the catalog where an entry with the passed datasource_name must exist.

    Using the catalog feature the catalog data source must be provided in a catalog [DATA-CATALOG] section of the ini-file (local application) or in a corresponding section of the server. The resource definitions in the data source are filled from the corresponding resource definitions in the catalog entry before opening the data source.

    The passed client is set as current data source client. In order to setup data source variables properly, the client passed should be initialized with an appropriate ini-file.

    • client_refc - Reference to client handle
    • datasource_name - Name of the data source

      The name of the data source defines the section in the ini-file or as an entry in the data catalog that contains external data source definitions.

  4. to list
  5. Opening data source based on ini-file section
    logical DataSourceHandle  :: Open ( ODABAClient &client_refc, NPath &ini_file, NString &datasource_name )

    The function opens the data source based on external resource definitions passed in the ini-file. The ini-file section name containing the resource definitions is passed as datasource_name to the function. The resource definitions in the data source are filled from the corresponding resource definitions in the ini-file.

    The data source client is replaced by the client handle passed to the function. Usually, an empty client handle might be passed, which will be initialized with data from the ini-file. In order to keep the existing variable definitions, the current variable state is pushed and popped after initializing data source variables from the ini-file.

    • client_refc - Reference to client handle
    • ini_file - Application ini-file
    • datasource_name - Name of the data source

      The name of the data source defines the section in the ini-file or as an entry in the data catalog that contains external data source definitions.

  6. to list