VERIFIED SOLUTION i

How to use SQLConnectionObject object from IMHDialogServerServices interface in Portrait Dialogue?

Interface IMHDialogServerServices has a object called SQLConnectionObject.

object SQLConnectionObject( string ConnectionName )

The IMHDialogServerServices interface supports general functionality in the Dialogue Server but it is not a part of Dialog Server COM+ interface.
It is an interface accessible through the DialogServer object which is made available to all mh plugins (branch plugin in the example below) in the InitializePlugin method that is called by the Dialogue Server after loading the COM object (the plug-in), before any other methods of the plug-in are called.

SQLConnectionObject returns a reference to an ADO connection object. ConnectionName is the name of the secondary database defined in Dialogue Admin. Setting this argument to null returns the default connection object used to access the Dialogue Server database.

Example below shows how the object can be used in the code however the example itself does not do anything useful.

ADODB.Connection conn = (ADODB.Connection)DialogServer.SQLConnectionObject(null);

object recordsAffected;

ADODB.Recordset rs = conn.Execute("select * from dialogue", out recordsAffected);

while (!rs.EOF)
{
BranchInfo.ReportProgressStatus(rs.Fields[0].Value.ToString(), 0);
rs.MoveNext();
}

The object is also mentioned in the Portrait Dialogue Reference Guide (on page 200 in Reference Guide Version 6.1)
UPDATED:  September 5, 2017