Hi All,
I have a total anomaly when tapping into a session and/or creating a new session.
I have one instance where my normal code that usually works like a charm, opens the session manager, but on the .CreateSession fails to tap into or create the session. It jumps at the .CreateSession line to the error trap. It however opens the Signon Manager, but with no Session ID entry:
Option Compare Database
Option Explicit
Public Session As AccpacCOMAPI.AccpacSession
Public Signon As New AccpacSessionMgr
Public lSignonID As String
Public AnyError As Boolean
Public OpenSession As Boolean
Public mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Public mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Public Accpac_User As String
Public Accpac_CompanyID As String
Public Accpac_CompanyName As String
Public Function OpenMyModule(MyAppID As String, MyProg As String)
On Error GoTo Err_OpenModule
OpenSession = False
lSignonID = 0
Set Signon = New AccpacSessionMgr
With Signon
.AppVersion = "65A"
.AppID = MyAppID
.ProgramName = MyProg
.ForceNewSignon = False
.CreateSession "", 1, Session
End With
OpenSession = True . . . . . . etc.
I've changed the script to include Set Session = New AccpacCOMAPI.AccpacSession, force a signoff of session 1 and also force a new session to initialize session 1 again:
Set Session = New AccpacCOMAPI.AccpacSession
OpenSession = False
lSignonID = 0
Set Signon = New AccpacSessionMgr
With Signon
.AppVersion = "65A"
.AppID = MyAppID
.ProgramName = MyProg
.Signoff "1"
.ForceNewSignon = True
.CreateSession "", 1, Session
End With
OpenSession = True
RvSpy and DBSpy does not show me anything.
I'm using Sage 300 (2018) and tried both a workstation install and a local instance. The PC runs on Win8.1 with Office 2013 32-bit.
It might be that a security setting somewhere prevents the signon, but I've also disabled the antivirus and all of the folders have full read/write access.
Thanx in advance for your replies.
I have a total anomaly when tapping into a session and/or creating a new session.
I have one instance where my normal code that usually works like a charm, opens the session manager, but on the .CreateSession fails to tap into or create the session. It jumps at the .CreateSession line to the error trap. It however opens the Signon Manager, but with no Session ID entry:
Option Compare Database
Option Explicit
Public Session As AccpacCOMAPI.AccpacSession
Public Signon As New AccpacSessionMgr
Public lSignonID As String
Public AnyError As Boolean
Public OpenSession As Boolean
Public mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Public mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Public Accpac_User As String
Public Accpac_CompanyID As String
Public Accpac_CompanyName As String
Public Function OpenMyModule(MyAppID As String, MyProg As String)
On Error GoTo Err_OpenModule
OpenSession = False
lSignonID = 0
Set Signon = New AccpacSessionMgr
With Signon
.AppVersion = "65A"
.AppID = MyAppID
.ProgramName = MyProg
.ForceNewSignon = False
.CreateSession "", 1, Session
End With
OpenSession = True . . . . . . etc.
I've changed the script to include Set Session = New AccpacCOMAPI.AccpacSession, force a signoff of session 1 and also force a new session to initialize session 1 again:
Set Session = New AccpacCOMAPI.AccpacSession
OpenSession = False
lSignonID = 0
Set Signon = New AccpacSessionMgr
With Signon
.AppVersion = "65A"
.AppID = MyAppID
.ProgramName = MyProg
.Signoff "1"
.ForceNewSignon = True
.CreateSession "", 1, Session
End With
OpenSession = True
RvSpy and DBSpy does not show me anything.
I'm using Sage 300 (2018) and tried both a workstation install and a local instance. The PC runs on Win8.1 with Office 2013 32-bit.
It might be that a security setting somewhere prevents the signon, but I've also disabled the antivirus and all of the folders have full read/write access.
Thanx in advance for your replies.