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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting ACCPAC Company to Log into 1

Status
Not open for further replies.

Simboti1

IS-IT--Management
Sep 12, 2008
31
BW
I have written a stand alone VB6 app that picks data from ACCPAC. I have created a form that passes the user name and password to access ACCPAC as follows: -

theSession.Open(txtUSERID, txtPASSWORD, "SAMINC", dNow, 0)

My challenge is How can I have access to the ACCPAC Companies so that the user can scroll and chose which company to log into. In this example I have hard-coded "SAMINC". However, I want it to be dynamic and be chosen by the user
 
Don't bother with your own form, use this snippet and the standard login UI is presented:

Public Session As AccpacSession
Public SessMgr As AccpacSessionMgr
Public lSignonID As Long

lSignonID = 0 ' MUST be initialized to 0 since you don't have a signon ID yet
Set SessMgr = New AccpacSessionMgr
With SessMgr
.AppID = "AS"
.AppVersion = "53A"
.ProgramName = "AS0001"
.ServerName = "" ' empty string if running on local computer
.CreateSession "", lSignonID, Session ' first argument is the object handle (if you don't have one, pass "")
End With ' mSessMgr

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top