cancel
Showing results for 
Search instead for 
Did you mean: 

Can not connect to second company after 9.0 upgrade

pieter_verhaeghe
Explorer
0 Kudos

See my source code below:

//Connect to UI API

SboGuiApi SboGuiApi = new SboGuiApi();

string connString = Environment.GetCommandLineArgs().GetValue(1).ToString();

SboGuiApi.Connect(connString);

application = SboGuiApi.GetApplication();

// Connect to DI API (first company)

company1 = (SAPbobsCOM.Company)application.Company.GetDICompany();

// Connect to DI API (second company)

company2 = new SAPbobsCOM.Company();

string cookie = company2.GetContextCookie();

string connContext = application.Company.GetConnectionContext(cookie);

if(company2.SetSboLoginContext(connContext) == 0){

                company2.CompanyDB = "dbname2";

                company2.Connect();

                if(!company2.Connected){

                    SAP.application.StatusBar.SetText(company2.GetLastErrorDescription(), BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);

                    // STOP

                }

}

System.Windows.Forms.Application.Run();

My add-on makes a DIAPI connection with 2 companies. This code worked well with SAPB1 8.82. When I did the upgrade to 9.0 PL04 previous week, my add-on no longer connects to the second company and gives this error: "Unable to connect with the specified username and or password".

What must be changed in my source code to make the connection of the second company to work again?

Thanks for you help!

Regards,

Pieter

View Entire Topic
edy_simon
Active Contributor
0 Kudos

Hi Pieter,

In new SBO 9 there is a new restriction in place for user login.

Basically, the same user may only login to the same company once.

But based on our testing, it is still very buggy.

I notice that you are connecting to different company.  Yet you are getting the restriction.

Maybe you can open a ticket for support.

Based on my testing, if you connect the 2nd company by providing user name and password instead of using cookie, you should not get this problem.

Regards,

Edy

pieter_verhaeghe
Explorer
0 Kudos

Thanks for your answer. If you find a SAP note related to this problem, please post it in this topic so I can follow up on this.

Thanks,

Pieter