cancel
Showing results for 
Search instead for 
Did you mean: 

B1 SDK DI connect retrun -10

Former Member
0 Kudos

Could some one tell me fix this problem?

or tell me how to investigate the cause of this problem.

environment

Client Windows7/ Serer Windows 2008/SQL2008R2

SDK for B1 9.0 run on visual studio 2015.

I just try to connect to server with DI VB sample.

Dim oCompany As SAPbobsCOM.Company
    Dim retval As Integer
    Dim retstr As String
    Dim ConnectToCompany As Boolean

    set oCompany = New SAPbobsCOM.Company

    oCompany.Server = "192.168.1.44"
    oCompany.CompanyDB = "confirmation"
    oCompany.UserName = "A002"
    oCompany.Password = "xxxx"

    oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008

    oCompany.LicenseServer = "192.168.1.44:30000"
    'oCompany.language = 30 ' Japanese

    retval = oCompany.Connect

I home retval =0 but it returns -10

Please tell me to how to fix this problem or give me a hint.

-10: something like "specified resource not find in image file" message in Japanese.

UI sample connect without any problem.

Thanks in advance and best regards.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks everyone who gave me hints.

After change server SQL change from SQL2008 to 2012, It worked.

It may hint someone who struggling with RC -10.

Best regards

Answers (3)

Answers (3)

Former Member
0 Kudos

I don't need to input the port : 30000 in license or in the server.

This is how I connect:

            Try

                oCompany = New SAPbobsCOM.Company

                oCompany.Server = txtServerName.Text ' "192.168.1.33\R2"

                oCompany.DbUserName = txtDbUser.Text

                oCompany.DbPassword = txtDbPass.Text

                oCompany.CompanyDB = txtDbName.Text

                oCompany.UserName = txtSAPUser.Text

                oCompany.Password = txtSAPPass.Text

                oCompany.LicenseServer = txtLicenseServer.Text  ' "192.168.1.33"

                oCompany.DbServerType = cmbServerType.EditValue

                oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English

                If Not oCompany.Connect = 0 Then

                    oWriteText(lsView, oCompany.GetLastErrorDescription, Color.Red, True)

                    oWriteText(lsView, ".......................")

                    Me.Cursor = Cursors.Default

                    Return

                End If

Former Member
0 Kudos

Thank you for your input Gomez.

Tried to erase port:30000 but result unchanged.

regards

pedro_magueija
Active Contributor
0 Kudos

Hi Kawada,

In your code did you also include the DbUserName and DbPassword?


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hello Magueija,

thank you for your update.

After set the DbUserName and DbPassword retrun changed -111.

famous "Unable to access SBO-common database" error.

I ensured username/password from SQLserver management console but it could access.

Best regards

Former Member
0 Kudos

Can you please post your code with exact value from this format.

                oCompany.Server = txtServerName.Text ' "192.168.1.33\R2"

                oCompany.DbUserName = txtDbUser.Text

                oCompany.DbPassword = txtDbPass.Text

                oCompany.CompanyDB = txtDbName.Text

                oCompany.UserName = txtSAPUser.Text

                oCompany.Password = txtSAPPass.Text

                oCompany.LicenseServer = txtLicenseServer.Text  ' "192.168.1.33"

                oCompany.DbServerType = cmbServerType.EditValue

                oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English

pedro_magueija
Active Contributor
0 Kudos

Hi Kawada,

You are using the IP for the db server. This works when the default instance is in use. Make sure that if you are using several SQL instances that the instance name is also in the Server.

You can see an example in @Bryan_Gomez reply: "ip\instance_name"


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

pedro_magueija
Active Contributor
0 Kudos

Hi Kawada,

Check these threads:

https://scn.sap.com/thread/3880761

https://scn.sap.com/thread/1902039


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Thank you for your recommendations Magueija.

I erased temp\SM_OBS_DLL and temp\SM_OBS_DLL64

result unchanged.

Regards

former_member183373
Active Participant
0 Kudos

Hello Kawada,

Issue is probably related to how you enter the server or database name. Make sure you are entering the same values as in the SAP Business One Client, Choose Company form. Other possibility is that your server configured by server name not IP. In this case you may have to use something like oCompany.Server = "ServerName:30000"


Also could you please try below code.


    Dim oCompany As SAPbobsCOM.Company

    Dim retval As Integer

    Dim retstr As String

    Dim ConnectToCompany As Boolean

    set oCompany = New SAPbobsCOM.Company

    oCompany.Server = "192.168.1.44:30000"

    oCompany.CompanyDB = "confirmation"

    oCompany.UserName = "A002"

    oCompany.Password = "xxxx"

    oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008

    retval = oCompany.Connect

Thanks,

Atilla

Former Member
0 Kudos

Thank you for your recommendation Genç.


I tried change IP to servername  oCompany.Server


result is still inchanged and -10 retturned.


regards