Skip to Content
0
Former Member
Dec 06, 2013 at 03:59 PM

Unable to access SBO-Common database

39 Views

Hi,

(I am new in SAP SDK development)

I am using this code to get a connection to company database

private void ConnectToCompany() { 
            
            //  Initialize the Company Object.
            //  Create a new company object
            oCompany = new SAPbobsCOM.Company(); 
            
            //  Set the mandatory properties for the connection to the database.
            //  To use a remote Db Server enter his name instead of the string "(local)"
            //  This string is used to work on a DB installed on your local machine


            oCompany.Server = "TS0022-LAPTOP"; 
            oCompany.CompanyDB = "SBODemo_US"; 
            oCompany.UserName = "manager"; 
            oCompany.Password = "manager"; 
            oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English; 
            oCompany.DbUserName = "vssa";
            oCompany.DbPassword = "123456.";
            oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2012;           
            oCompany.UseTrusted = false;
           // oCompany.LicenseServer = "TS0022-LAPTOP:30000";
            
            int valor = oCompany.Connect();
            
            //  Check for errors during connect
            int transTemp6 = System.Convert.ToInt32( lErrCode ); 
            oCompany.GetLastError( out valor, out sErrMsg ); 
            if ( lErrCode != 0 ) { 
                Interaction.MsgBox( sErrMsg, (Microsoft.VisualBasic.MsgBoxStyle)(0), null ); 
            } 
            else { 
                Interaction.MsgBox( "Connection Established", MsgBoxStyle.Information, null ); 
            } 
            
        } 

When I try to get the connection this give me -111 error. "Unable to access SBO-Common database" what is wrong?

I have all the environment in my machine.