Try OpenEdge Now
skip to main content
Introducing the OpenEdge DataSet : Data-Source object : Defining a static Data-Source : Data-Source as a separate object
Data-Source as a separate object
Defining the Data-Source as a separate object allows you to define the ProDataSet without having to combine the Data-Source definitions with the ProDataSet definition. When a ProDataSet is passed to another session, the Data-Sources are not passed as part of the object, since they have no meaning on another session and their database tables cannot normally be referenced there. Separating the ProDataSet from its Data-Sources also allows a ProDataSet to attach and detach Data-Sources during program execution, and to switch Data-Sources when this is necessary, for example to retrieve data from different databases. You cannot pass a Data-Source as a parameter, but you can access the handle of an attached Data-Source through its ProDataSet if the ProDataSet is passed locally. You can also simply include the same Data-Source definition in multiple procedures where this is appropriate.
However, once the Data-Source is instantiated as an actual object instance, it can be attached to only one ProDataSet at a time.