Configuring PSQL Servers with DTO : DtoServices Object
 
DtoServices Object
This object is a collection of DtoService objects, representing the PSQL services running on the server.
Properties
Status
Returns the status of a service. You must pass the service of which you want the status:
dtoServiceTransactional
dtoServiceRelational
dtoServiceIDS
StatusString
Returns the string representation of the current status.
Methods
RestartAllServices method
StartRelational method
StartTransactional method
StopRelational method
StopTransactional method
StartDXAgent
StartDXReplication
StopDXAgent
StopDXReplication
Remarks
The methods of DtoServices control the PSQL engine services running on the machine you connected to with the DtoSession object. All these methods return the enumeration DtoResult.
This object lets you start and stop the PSQL engine services running on Windows platforms. Also, you can query the current status of PSQL services using the Status or StatusString properties.
Security Information Regarding DtoServices Object
This object uses the same user name and password as the DtoSession object to connect to a Windows server.
When using the methods of this object from a web application hosted by Microsoft Internet Information Service (IIS), you must set properties on the directory where the DTO web application resides so that IIS allows DTO to run in the same process as the IIS service. Otherwise, you can obtain the current state of the services, but using the start or stop methods returns DTO error 431 (access denied). To set the IIS folder properties needed for the methods of the DTO Services object, perform the following procedure on folders where DTO web applications are located. Consult your Microsoft IIS documentation for more information on IIS configuration.
To configure IIS to allow starting and stopping of services from a DTO web application
1 Click Start, select Settings and point to Control Panel.
2 Double-click Administrative Tools.
3 Double-click Internet Service Manager.
4 Browse to the folder containing your DTO ASP application.
5 Right-click the folder in the left pane and select Properties.
6 Click the Directory tab.
7 Specify Low (IIS Process) in the Application Protection field as shown in Figure 1.
Figure 1 Required IIS Directory Properties for DTO Services Methods
Examples
’ This example connects to a server and restarts all
’ PSQL services.
 
Dim my_session as new DtoSession
Dim my_services as DtoServices
Dim result as DtoResult
 
result = my_session.Connect("myserver", "username", "password")
Set my_services = my_session.Services
result = my_services.RestartAllServices
 
’ This example connects to a server and starts the
’ DataExchange (DX) Agent service and the DX replication
’ service.
 
Dim my_session as new DtoSession
Dim my_services as DtoServices
Dim result1 as DtoResult
Dim result2 as DtoResult
 
result = my_session.Connect("myserver", "username", "password")
Set my_services = my_session.Services
result1 = my_services.StartDXReplication
result2 = my_services.StartDXAgent
See Also
DtoSession Object
DtoSetting Object
Methods Detail
RestartAllServices method
Stops and then restarts the services for transactional, relational, DataExchange (DX) agent, and DX replication.
Syntax
result = Services.RestartAllServices
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StartRelational method
Starts the Relational service.
Syntax
result = Services.StartRelational
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StartTransactional method
Starts the Btrieve transactional engine service.
Syntax
result = Services.StartTransactional
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StopRelational method
Stops the Relational engine service.
Syntax
result = Services.StopRelational
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StopTransactional method
Stops the Btrieve transactional engine service.
Syntax
result = Services.StopTransactional
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StartDXAgent
Starts the DataExchange (DX) agent service. The DX agent is a component that detects critical replication failures and notifies administrators by e‑mail. See the chapter “Using the DataExchange Utilities and Services” in DataExchange Userユs Guide for more information about DX agent.
You can start the DX agent service before the DX replication service, but the agent returns a message informing you that replication is stopped. This is expected behavior because the replication service is not yet running.
Syntax
result = Services.StartDXAgent
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StartDXReplication
Starts the DataExchange (DX) replication service (the Replication Engine). The Replication Engine captures and shares changes from one PSQL database to other databases in a DataExchange replication network. See DataExchange Userユs Guide for more information about the Replication Engine.
Starting the replication service also starts the transactional and the relational services.
Syntax
result = Services.StartDXReplication
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StopDXAgent
Stops the DataExchange (DX) agent service. The DX agent is a component that detects critical replication failures and notifies administrators by e‑mail. See the chapter “Using the DataExchange Utilities and Services” in DataExchange Userユs Guide for more information about DX agent.
Syntax
result = Services.StopDXAgent
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
StopDXReplication
Stops the DataExchange (DX) Replication Engine. The Replication Engine captures and shares changes from one PSQL database to other databases in a DataExchange replication network. See DataExchange Userユs Guide for more information about the Replication Engine.
Syntax
result = Services.StopDXReplication
Arguments
Services
DtoServices object
Return Values
result
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.