cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Conect to sap b1 10.00.110 via DI aPI

cbarreto
Newcomer
0 Likes
940

Dears,

I am using vb.net to connect SAP Business One 10.00.170 via DI API using following code which works perfectly , but when i try to conect to 10.00.110 and facing following error while connecting to DB.

-132 Error during SBO user authentication
public SAPbobsCOM.Company fnGetCompany()
{
oCompany = new Company()
oCompany.Server = "10.10.50.101"
oCompany.DbServerType = BoDataServerTypes.dst_MSSQL2017
oCompany.CompanyDB = "TEST_COMPANY"
oCompany.UserName = "manager";
oCompany.Password = "****";
oCompany.DbUserName = "****";
oCompany.DbPassword = "*****";
oCompany.UseTrusted = true;
oCompany.language = BoSuppLangs.ln_English;
int result = oCompany.Connect();
if (result != 0)
{
MessageBox.Show( oCompany.GetLastErrorCode() + " " + oCompany.GetLastErrorDescription());
}
return oCompany;

}

What could be possible reasons ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Chuma
Active Contributor
0 Likes

Hello @cbarreto @Lucidio 

Here’s a precise checklist and a corrected connection snippet for SAP Business One 10.00.110 via DI API. Error -132 (Error during SBO user authentication) almost always boils down to one of the items below.

What to fix/check (in order)

Version/patch match (critical)

  • The DI API version must match the server patch (or be the exact same Feature Package level).
  • If your app machine has 10.00.170 DI API but the server/company DB is 10.00.110, install the 10.00.110 DI API on the app machine (and reference that).
  • Also ensure 32-bit vs 64-bit matches your application target (x86 app → 32-bit DI API; x64 app → 64-bit DI API).

License Server must be set

  • Always set LicenseServer = "<host>:30000" where <host> is the SAP Business One License Manager host (not SQL host unless they’re the same machine).

Pick ONE DB authentication mode

  • If you set UseTrusted = true, do not set DbUserName/DbPassword. The DI API will try Windows authentication for SQL Server.
  • If you want SQL authentication (most common), set UseTrusted = false and provide valid DbUserName/DbPassword (SQL login with rights on SBO-COMMON and the company DB).

Company user is SAP B1 user (not SQL)

  • UserName/Password are SAP Business One credentials (e.g., manager).
  • Verify that user can log in with the SAP Business One Client 10.00.110 to that same company and is not locked / password expired by policy.

Server/Instance and DB type

  • Server must be the SQL Server host (and instance if named), e.g. "10.10.50.101\\SQL2017" (double backslash in C# string).
  • DbServerType must match exactly (e.g., dst_MSSQL2017).

SBO-COMMON & Company DB state

  • Ensure the target CompanyDB is upgraded to 10.00.110 and SBO-COMMON is consistent. Log in once with the B1 client to confirm no pending upgrades.

Network/DNS basics

  • If using IP fails, try the machine name; ensure no firewall blocks to License Server (TCP 30000) and SQL (default 1433 or instance port).

Corrected sample (C#)

using SAPbobsCOM;

 

public Company ConnectB1()

{

    var oCompany = new Company

    {

        // SQL Server host (add instance if needed, e.g. "10.10.50.101\\SQL2017")

        Server = "10.10.50.101",

        DbServerType = BoDataServerTypes.dst_MSSQL2017,

 

        // Company database

        CompanyDB = "TEST_COMPANY",

 

        // SAP Business One user credentials (NOT SQL)

        UserName = "manager",

        Password = "******",

 

        // Use SQL authentication for DB (common)

        UseTrusted = false,

        DbUserName = "sql_user",

        DbPassword = "sql_password",

 

        // MUST point to the B1 License Server host:30000

        LicenseServer = "B1-LIC-HOST:30000",

 

        language = BoSuppLangs.ln_English

    };

 

    int rc = oCompany.Connect();

    if (rc != 0)

    {

        oCompany.GetLastError(out int errCode, out string errMsg);

        throw new ApplicationException($"DI API connect failed: {errCode} - {errMsg}");

    }

 

    return oCompany;

}

 

If you really need Windows (trusted) auth:

UseTrusted = true;

// Do NOT set DbUserName/DbPassword in this case.

// Ensure the Windows account running the process has SQL access to SBO-COMMON and the company DB.

Fast diagnostics for -132

  • Works on 10.00.170 but fails on 10.00.110 → Almost always DI API patch mismatch or LicenseServer not set.
  • Can log in with B1 client, but DI API fails → Check LicenseServer, auth mode (trusted vs SQL), Server\Instance string.
  • Still failing → Try the exact same B1 user in the client on the same machine; if prompted to change password or locked, fix that first.

Let me know if you need further support

with kind regards

Chuma

 

 

GenAI assist content(Reference Articles and Guides for helpful information and guidance)