Skip to Content

asp.net access - getting -111

Hi,

how do i use asp.net to connect to sbo?

I have a small code example here but i keed getting a -111 result back.

public static SAPbobsCOM.Company sboCompany;

private void Page_Load(object sender, System.EventArgs e) {

sboCompany = new SAPbobsCOM.CompanyClass();

sboCompany.Server = "localhost";

sboCompany.UserName = "sa";

sboCompany.Password = "*****";

sboCompany.CompanyDB = "SBODemo_DK";

sboCompany.LicenseServer = "localhost";

sboCompany.language=BoSuppLangs.ln_Danish;

sboCompany.UseTrusted = true;

int result = -1;

result = sboCompany.Connect();

if (result != 0) {

TextBox1.Text = result.ToString();

}

}

Can any1 help me resolve this???

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Apr 18, 2005 at 02:03 PM

    I don't know wheter this is a difference from programming with asp.net and vb6, but have you already tryed:

    sboCompany.Server = "(local)";

    instead of

    sboCompany.Server = "localhost";

    ?

    That's what I do in VB6.

    Florian

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      If you upgrade to SAP 2004

      You cannot run that application on a diferent server where you have your license installed...

      Move your ASP Application to the same server where you install the license (maybe is the same server where you have your production database)

      This is going to solve errors for:

      1. Cannot connect to SBOCommon

      2. Access is denied

      This is the code that you have to use to connect to your data base

      =============================================

      Dim vCompany As SAPbobsCOM.Company

      vCompany = New SAPbobsCOM.Company

      vCompany.DbServerType = BoDataServerTypes.dst_MSSQL

      vCompany.Server = "YOUR SAP-SERVER"

      vCompany.CompanyDB = "YOUR DATABASE"

      vCompany.UserName = "YOUR USER"

      vCompany.Password = "YOUR USER PASSWORD"

      vCompany.DbUserName = "YOUR DATABASE USER" '(sa)

      vCompany.DbPassword = "YOUR DATABASE USER PASSWORD"

      vCompany.UseTrusted = False

      =============================================

      good luck fellas

  • author's profile photo
    Former Member
    Apr 19, 2005 at 03:39 AM

    This is the code I use to connect in an asp.net page:

    Private Sub ConnectToCompany()

    oCompany = New SAPbobsCOM.Company

    oCompany.Server = "servername"

    oCompany.CompanyDB = "databasename"

    oCompany.UserName = "username"

    oCompany.Password = "password"

    oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English

    oCompany.Connect()

    oCompany.GetLastError(lErrCode, sErrMsg)

    If lErrCode <> 0 Then

    Response.Write("error connecting to company: " & sErrMsg)

    End If

    End Sub

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 05, 2005 at 11:34 PM

    So it is impossible to have the database server on one machine, and use asp.net on another machine to access through sapbobscom?

    Add comment
    10|10000 characters needed characters exceeded