Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

Connection to SAP B1

$
0
0

Hello Experts,
I want to connect SAP B1 through Visual studio.
i have seen below coding in many places and tried the same for my connection but i am failed each time to connect. Sometime shows error 111 (Unable to access common database) occurred. 

 

Please Suggest me How i can connect.

 

 

oCompany = New SAPbobsCOM.Company

oCompany.Server = "sapsrv”

 

 

oCompany.CompanyDB = "SBODemo_UK"

 

 

oCompany.UserName = "manager"

oCompany.Password = "B1Admin”

 

 

oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2014

 

 

oCompany.DbUserName = "sa"

 

 

oCompany.DbPassword = "sapass"

 

 

oCompany.LicenseServer = "sapsrv:30000”

 

retVal = oCompany.Connect

 

If retVal <> 0 Then

 

 

oCompany.GetLastError(retVal, retStr)

 

 

MsgBox("Error " & retVal & " " & retStr)

 

 

Else

 

 

MsgBox("Connected to " & oCompany.CompanyName)

 

 

End If


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>