Professional > Interview scripting > Using Interview Services > Database Connection Interview Service > The Database Connection Interview Service interface
 
The Database Connection Interview Service interface
IService interface
In order for an object to be usable as a service by the ServicesManager in InterviewServices.dll, the object must implement the IService interface.
The Name property is always returned as DatabaseConnection.
Properties returns an array that contains objects with IPropertyMetadata interfaces that represent the following properties (the IPropertyMetadata object can be used to retrieve each localized property name).
CommandTimeout
Indicates how long to wait while establishing a connection before terminating the attempt and generating an error.
ConnectionString
Contains the information used to establish a connection to a data store.
ConnectionTimeout
Indicates how long to wait while executing a command before terminating the attempt and generating an error.
CursorLocation
Sets or returns a value determining who provides cursor functionality.
ConnectMode
Sets or returns a value determining who provides the connect mode.
AutoCloseInterval
Indicates how long to wait while GetConnection() is not called, before it automatically closes the connection.
ConnectionFactory
ServiceObject that always returns the same connection factory as DBConnectionService.ConnectionFactory.
IDBConnection interface
The IDBConnection interface is exposed to the interview routing script via the IOM.Services collection object. There is only a single DBConnectionService.Service object, and as such the IDBConnectionFactory object is shared by all running interviews.
The interface consists of a single method:
GetConnection() As IDispatch
GetConnection() returns a connected ADO connection object that can be immediately used, either by calling its Execute() method or by passing it to the Recordset.Open() method.
GetConnection() looks at the internal ADO Connection object's State property. When the State is adStateClosed, the method calls the Open() method and then returns the newly opened connection. When an error occurs calling Open(), the information is passed up to the GetConnection() caller. When the State is another value (for example, adStateOpen or adStateExecuting) the Connection object is immediately returned and auto close timer is reset.
See also
Database Connection Interview Service