company logo

DataSourceHandle :: DataSourceHandle - Constructor

The constructor creates a DataSourceHandle. Before opening a data source database paths and object and extent names have to be set. This can be done by explicitly setting the paths and names in the program or by means of an ini-file using the SetupVariables() function..

Implementation overview

Implementation details

  1. Constructing an empty data source
    DataSourceHandle  :: DataSourceHandle (  )

    The constructor creates an empty data source. When it is the first data source created, and when no client object has been created before, the constructor automatically creates the main client and initializes it. Therefore, we suggest to create a client in advance for initializing the main client properly with the application's configuration or ini-file.

      ODABAClient            client(ini_file,"myApplication");

      DataSourceHandle       dsh();

  2. to list
  3. Create a data source by options from ini-file
    DataSourceHandle  :: DataSourceHandle ( NPath &ini_file, NString &section_name )

    The constructor opens the data source using the options set in the configuration or ini-file passed in ini_file. Usually, the section name passed is the same as the application name, but it may also differ from the application name.

    When the data source is the first data source opened in an application an no ODABAClient has been opened so far, the data source creates a main client, which will initialize the system settings from the [SYSTEM] section or element defined in the configuration/ini-file. The passed section name will be set as main section, i.e. all options without a section prefix are searched in this main section.

      DataSourceHandle            dsh(ini_file,"myApplication");

    • ini_file - Application ini-file
    • section_name - - internal feature (not documented)
  4. to list