Init

ACCPAC Common Controls

AccpacSession.Init

Initializes a session with ACCPAC System Manager and opens the session if a valid object handle is supplied.

A Session object must first be initialized before any other object methods can be called.

Sub Init(
  ObjectHandle As String,
  AppID As String,
  ProgramName As String,
  AppVersion As String)

Parameters

ObjectHandle

[in] the object handle, or "", if the object handle is not available

The object handle is passed by other System Manager routines and allows sessions to be opened without supplying a username and password. It is usually available if the application is launched by the ACCPAC desktop, or by another ACCPAC application.

AppID

[in] the two-letter application ID of the application object (also known as a registered module prefix, and has the form XX, such as "AR")

If the caller is not a registered ACCPAC module, use "XZ" which is reserved for macros and applications that do not have an ACCPAC registered module prefix.

ProgramName

[in] the Roto ID of the application

The program name should be of the form XXNNNN where XX is the application ID and NNNN is a number. If the caller is not a registered ACCPAC module, NNNN can be any number, such as "XZ1000".

AppVersion

[in] the 3-character application version of the form NNX, such as "51A"

Remarks

If a valid object handle is supplied (obtained from a previous call to CreateObjectHandle or when the application is launched by the ACCPAC desktop), the session is initialized and immediately opened. If an object handle is not available, an empty string ("") should be passed in and the session will be initialized but not opened. The application must then call Open to open the session.