Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : ABL API for Multi-tenant and Table Partition Management : Instantiating a DataAdminService
 

Instantiating a DataAdminService

You can instantiate a DataAdminService for one database. The service methods, entity objects, and entity collection objects for that service instance all apply to that single database.
The following code shows how to instantiate the service for a connected database by passing the logical database name to the constructor:
using OpenEdge.DataAdmin.DataAdminService.

define variable service as DataAdminService no-undo.
service = new DataAdminService("sportsmt").
Note: The sportsmt database refers to the multi-tenant database sample installed with OpenEdge. For information on configuring sportsmt for use, see Configuring the sample multi-tenant database.
You can also instantiate the service by specifying the full physical path and database name in the constructor as follows:
service = new DataAdminService("C:\OpenEdge\WRK\db","sportsmt").
The database connects multi-user if there is a database server available and connects single user if no server is available.
The sportsmt database in this code refers to the sample multi-tenant database that is available with the OpenEdge release. For more information, see Configuring the sample multi-tenant database.