Skip to Content
author's profile photo Former Member
Former Member

Troble when connecting to Company using DI

Hi All

I have trouble when try to connect to SAP B1 (in the server) via DI using my application ( from client PC. It keeps returning error message : Can not connect to Company

But it didn;t happen if I try to connect to SAP B1 (in the same server and same company) via DI from my pc (debugging using

Can anybody help me to solve this problem?

Thanks Before

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Sep 22, 2008 at 07:46 PM


    The issue I think that you are running into is you are using the Development Addon Identifier string in your compiled code. While this will work for running your addon in Debug mode .. it will not work for compiled (exe) code. You either need a valid add-on identifier string in your compiled code or you need to run your add-on in Compatibility Mode.

    Please see the SAP Business One SDK Help Documentation and specifically the Packaging and Deployment section of the Help.


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 02:37 AM

    Dear Herfin Jodana,

    Could you put your connection code for investigation if the issue can not solve?

    Best Regards

    Jane Jing

    SAP Business One Forums team

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thx for your reply,


      My application is not an SAP add on. It just need to throw data (creating journal, AP, Credit Memo) to SAP database using DI.

      So I don;t think i need add on identifier, or do i ? please advise me 😊


      This is my connection code:

       Public Function up_SAP_Connect() As String
              Dim lRetCode, lErrCode As Long
              Dim sErrMsg As String = ""
              oCompany = New SAPbobsCOM.Company
              oCompany.Server = gs_SAPServer
              oCompany.CompanyDB = gs_SAPDatabase
              oCompany.UserName = gs_SAPDI_User
              oCompany.Password = gs_SAPDI_Pass
              oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
              oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English
              oCompany.UseTrusted = False
              oCompany.DbPassword = gs_SAPPass 'gs_SAPUser
              oCompany.DbUserName = gs_SAPUser 'gs_SAPPass
              lRetCode = oCompany.Connect()
              'Check Return Code
              If lRetCode <> 0 Then
                  oCompany.GetLastError(lErrCode, sErrMsg)
                  If sErrMsg <> "" Then
                      Return "SAP Connect Failed : " & sErrMsg
                      Return ""
                  End If
              End If
              Return ""
          End Function

      Edited by: Rui Pereira on Dec 23, 2008 2:42 PM

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.