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

Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)


I am having error on this code

gDI(i) = CreateObject("SAPbobsCOM.Company")

gDI(i).Server = Trim(rs("SAP_SERVER"))

gDI(i).CompanyDB = Trim(rs("SAP_DBNAME"))

gDI(i).DbUserName = Trim(rs("SAP_DBUSER"))

gDI(i).DbServerType = SAPDBTYPE

gDI(i).DbPassword = SAPClass.Decrypt(Trim(rs("SAP_DBPASS")), Trim(rs("SAP_DBUSER")))

gDI(i).UserName = Trim(rs("SAP_COUSER"))

gDI(i).Password = SAPClass.Decrypt(Trim(rs("SAP_COPASS")), Trim(rs("SAP_COUSER")))

gDI(i).language = sapObject.ln_English

If LicenseServer.Trim.Equals("") = False Then

gDI(i).LicenseServer = LicenseServer

End If

It is working on SAP B1 8.82

But when I try It on SAP B1 2007 i am having this error.

Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2014 at 04:12 AM


    Try this..

    oCompany = New SAPbobsCOM.Company

    oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008

    oCompany.LicenseServer = "ServerName:30000"

    oCompany.Server = "ServerName:30000"

    oCompany.CompanyDB = "DBName"

    oCompany.DbUserName = "SA"

    oCompany.DbPassword = "password"

    oCompany.UserName = "manager"

    oCompany.Password = "password"

    oCompany.UseTrusted = False

    dConnInt = oCompany.Connect

    If dConnInt <> 0 Then

    oCompany.GetLastError(errcode, erMsg)

    End If



    Add a comment
    10|10000 characters needed characters exceeded

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.