Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sage 300 Signon Manager does not create create session

Status
Not open for further replies.

ajwonder

Programmer
Aug 23, 2011
35
ZA
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.
 
Why do you want a signon manager? Are you running a screen or macro via code? Or are you just interacting with the views?
 
Hi DJangMan,

It is a custom application that runs from MS Access. They retrieve multiple transactions from a web utility and process them in one go, using the related views.
 
Then you don't need to use the signon manager. Just create an AccpacSession object and pass along the user id/password and go from there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top