Previous Topic

Next Topic

Book Contents

Book Index

COM (Component Object Model)

Accredo is a COM object. COM is Microsoft's framework for allowing applications to read, write and manipulate data in other applications without opening the application containing the source data.

With DI installed, you can read Accredo data, write to the Accredo database and run Accredo scripts within other applications such as Microsoft Access and Microsoft Excel. Because the COM framework allows direct access to the Accredo database, there is no need to develop DI routines or transfer data using time-consuming file exchange processes. All Accredo business rules, plus rules included in scripts, still apply, ensuring data integrity is protected. See OLEDB/ODBC for information on Microsoft protocols that allow read-only access to Accredo files without opening Accredo.

To access Accredo data from other applications via the COM framework, register Accredo as a COM object.

Register Accredo as a COM Object:

Run the Accredo executable you want to register as a COM Object.

  1. Click File > Diagnostics
  2. Next to COM Exe (32bit or 64bit), click SetAsDefault Set COM Exe to this Exe

Register Accredo as a COM Object using regserver:

  1. Open a command prompt or PowerShell window.
  2. In the Open: field, type the path to the Accredo executable file, then a space, then /regserver
    (for example, C:\AccredoSaturn\AccredoSaturn.exe / regserver or C:\AccredoMercury\AccredoMercury.exe /regserver.

The Accredo COM object has the following properties:

Property

Type

Read Only

Description

LoggedIn

Boolean

Read Only

Returns True or False, showing whether a user is logged in to Accredo.

LoginName

String

Read Only

Returns the login name of the active Accredo user.

Visible

Boolean

 

True or False, determines whether Accredo is visible.

WindowState

Integer

 

0 - The Accredo window is shown normally.

1 - The Accredo window is maximised.

2 - The Accredo window is minimised.

The Accredo COM object has the following methods:

Method

Type

Parameters

Description

CreateObject

 

ObjectClassName as String

Creates an object with the name ObjectClassName.

GetSystemPath

String

 

Returns the system path.

SetSystemPath

 

SysPath as String

Sets the System path to Syspath.

Login

 

CompanyCode as String, UserCode as String, Password as String

Automatically logs in to a particular company using the UserCode and Password.

Logout

 

 

Logs out of Accredo.

PlayScriptFile

 

ScriptFileName as String

Runs an Accredo script file.

You can unregister Accredo as a COM object using the switch /unregserver.

The switch /COMLOCKTIMEOUT sets the number of milliseconds that the application will wait to obtain a lock for the COM session. This can avoid global deadlocks. See Command Line and Config File Switches for a full list of switches available.
The default timeout if one is not explicitly set is 5 minutes (300000 milliseconds).

The COM exe path can be viewed in the Diagnostics. You can also use the Diagnostics to reset the COM server path and the COM server exe file.

The Accredo default COM server path for both 32-bit and 64-bit versions is stored at:

HKEY_CURRENT_USER\Software\Profax\AccredoSaturn\SystemPath or

HKEY_CURRENT_USER\Software\Profax\AccredoMercury\SystemPath