cancel
Showing results for 
Search instead for 
Did you mean: 

AddOn Error - Cannot connect to SBO Common

former_member196647
Contributor
0 Kudos

Hi All,

I've an add-on created using DI-API. It has been working fine, but after some changes, it is now working on some computers and not working on others.

At the time of creating the connection to the di company, it gives an error saying cannot connect to sbo-common. On these computers, B1 client is otherwise working. I've tried everything, but it is still the same.

Any ideas??

Thanks,

Rahul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rahul,

Generally "Can't connect to SBO-COMMON" means there is some issue with the connection details.

- Have you defined the database server type?

- Are you sure the db username and password are correct?

- Can you make an ODBC connection from the client to the server?

- Can you connect to the exact same server (same name or IP address) using Business One?

If all of these details are correct, then try the following:

- Go to Start -> Run -> %temp%

- Delete SM_OBS_DLL in this folder

- Uninstall DI API from Add/Remove programs

- Reinstall DI from your latest patch

- Run the add-on again.

If the issue continues, please post up a code sample of your connection code.

Regards,

Niall

former_member196647
Contributor
0 Kudos

Hello Niall,

I'm able to connect to SAP Business One, and exactly to the same server. I've also uninstalled and installed everything again. On one of the machines, I've even formatted and installed OS from scratch.

Ideally, since I'm able to connect from some client machines, and not been able to connect from others, I understand there should not be an issue with the code. Still following is the code:



    Public Function Connect() As Boolean
        Dim IpAddress, User, Password, Company As String
        Dim UserName, UserPass As String
        Dim ReturnCode, ErrorCode As Integer
        Dim ErrorMsg As String = ""
        Dim Cv1 As ConnectVal

        Dim sConnectionString As String

        sConnectionString = Global.WindowsApplication1.My.Settings.SuyashConnectionString
        Cv1 = ProcessConnect(sConnectionString)

        IpAddress = Cv1.DataSource
        User = Cv1.UserName
        Password = Cv1.PassWord
        Company = Cv1.InitCatalog

        UserName = "manager"
        UserPass = "sspl"

        'Cursor = System.Windows.Forms.Cursors.WaitCursor 'Change mouse cursor

        '********************************************

        '********************************************

        Try
            oCompany = New SAPbobsCOM.Company
            oCompany.Server = IpAddress
            oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English
            oCompany.DbUserName = User
            oCompany.DbPassword = Password
            oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
            ' oCompany.LicenseServer = "192.168.0.1"

            'oCompany.UseTrusted = True
            'oRecordSet = oCompany.GetCompanyList

            oCompany.GetLastError(ErrorCode, ErrorMsg)
            oCompany.CompanyDB = Company
            oCompany.UserName = UserName
            oCompany.Password = UserPass

            Dim MsgString As String
            MsgString = "DbUserName = " & User & " " & oCompany.DbUserName
            MsgString = MsgString & Chr(13) & "DbPassword = " & Password & " " & oCompany.DbPassword
            MsgString = MsgString & Chr(13) & "Server = " & IpAddress & " " & oCompany.Server
            MsgString = MsgString & Chr(13) & "CompanyDB = " & Company & " " & oCompany.CompanyDB
            MsgString = MsgString & Chr(13) & "UserName = " & UserName & " " & oCompany.UserName
            MsgString = MsgString & Chr(13) & "Password = " & UserPass & " " & oCompany.Password

            MsgBox(MsgString, MsgBoxStyle.Information)

            ReturnCode = oCompany.Connect()
            If ReturnCode <> 0 Then
                oCompany.GetLastError(ErrorCode, ErrorMsg)
                MsgBox("Connection Failed - " & ErrorMsg, MsgBoxStyle.Exclamation, "Default Connection Failed")
                Return False
            End If
            If oCompany.Connected Then ' if connected
                MsgBox("Connected to " & oCompany.CompanyDB)
                Return True
            End If
        Catch ex As System.Exception
            MsgBox("Error while creating DI Company, " & ex.Message)
        End Try

        'Cursor = System.Windows.Forms.Cursors.Default '
    End Function

Thanks a lot,

Rahul Jain

former_member196647
Contributor
0 Kudos

By the way, what dll file is this. I've never read about it anywhere?

Rahul

former_member196647
Contributor
0 Kudos

The problem was solved, after installing the SQL Native Client on the machines, where the add-on was not running.

Thanks.

Rahul Jain

Answers (0)