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

How can identify the password while the session is open ?

Status
Not open for further replies.

sara403

Technical User
Jun 10, 2008
58
IN
Hi Everyone,

Here i use the following code to get user id , company id and company name in my development part .

Session.Init "", "PO", "PO1210", "54A"
userID = SignOn.SignOn(Session)
userID = Session.userID
Company_id = Session.CompanyID

but i want to know the password for which user is logged in accordingly. Please help me.


Thanks

Saravana Bavan
 
Hi
I use the following code for opening the item details (Note : OnRecordChanged event)

Session.Open userID, Password, Company_id, Date, 0
Dim Item_details As ACCPACXAPILib.xapiView
Set Item_details = Session.OpenView("ic0310", "ic")


i want avoid hard coding the user name and the password in my application.

When accpac is logged in, the values for the userid,company_id and Session date, i could manage to get details but unable to retrive the value for the password, i am unable to found through session relative function


Please advice regarding this.

Thanks

Saravana bavan.T

 
Again, you can't get the password, it's encrypted. If you want to use the current credentials in another company, use the .Clone method.
 
The best way to handle this is to have a login screen on your application. To do this, the user enters the CompanyID (eg. SAMINC), the username (eg. ADMIN) and their password (eg ADMINPWD).

Here is a small piece of code from our login screen.
Code:
'// Accpac xAPI Session object.
Private m_Sess As ACCPACXAPILib.xapiSession

...

'// Create, set and open a global accpac XAPI session object.
Set m_Sess = CreateObject("ACCPAC.xapisession")
m_Sess.Open Trim$(pzeUser.Text), Trim$(pzePassword.Text), Trim$(pzeCompany.Text), Date, 0
lblACCPACTest.Caption = "Sage Accpac login successful."

This is the method that my company uses. We store all three values in the local machine registry (or in an SQL database), however we encrypt the password before saving.

This allows you to reference any of the fields at any given time and still provides security to the user. Also, by opening a global session, you do not need to reopen it everytime you access a view.

Things to keep in mind:
- Sage Accpac System Manager is to be installed locally.
- At least one IAP User licence is available.
- The company name has correct spelling.
- The user name and password are valid.
- All of the proper or required modules are installed.

Hope this bit of information helps.
 
Assuming you are using Accpac 5.4, why are you using XAPI?
Is this in VBA or VB?
In VBA you do not need login credentials since the session is already established.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top