cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos
451

Hi,

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)

Accepted Solutions (0)

Answers (1)

Answers (1)

pvsbprasad
Active Contributor
0 Kudos

hi,

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

Regards,

Prasad