Our BOI boilerplate is:
'Login Definitions
strUser = ""mas-user""
strPass = ""pass""
strCompany=""ABC""
'Program Variables
r = 0
cnt = 0
strPathRoot = """"
strAcctDate = """"
QUO = Chr(34) ' Quote character
Const HKEY_CURRENT_USER = &H80000001
'Object Definitions
oReg = 0' Registry Access
oScript = 0' MAS Primary Object #1
oSession = 0' MAS Session Object
'Get MAS 90/200 info from ODBC SOTAMAS90 DSN
Set oReg = GetObject(""winmgmts:\\.\root\default:StdRegProv"")
oReg.GetExpandedStringValue HKEY_CURRENT_USER,""Software\ODBC\ODBC.INI\SOTAMAS90"",""Directory"",strPathRoot
Set oReg = Nothing
'Create ProvideX COM Object and Session
Set oScript = CreateObject (""ProvideX.Script"")
oScript.Init(strPathRoot & ""\Home"")
Set oSession = oScript.NewObject(""SY_Session"")
'Grab the user's information
r = oSession.nSetUser(strUser,strPass)
If r = 0 Then ErrorHandling(""Setting User/Pass for "" & strUser)
r = oSession.nLogon()
' Set the company, module date and module for the Session using info from Login Definitions above
strAcctDate = YEAR(Date()) & Right(""0"" & Month(date()),2) & Right(""0"" & DAY(date()),2)
r = oSession.nSetCompany(strCompany)
If r = 0 Then ErrorHandling (""Setting Company to "" & strCompany)