📚 SAP Business One SDK Help

Connect Method
See Also 

Description

Connects to the SAP Business One company database.

Syntax

Visual Basic
Public Function Connect() As Long

Return Type

0 if the method succeeds; otherwise, an error code.

You can retrieve the last error code and its description with the method GetLastError.

Remarks

Before calling this method, set proper values to the following properties: Server, CompanyDB, UserName Password, DbUserName, DbPassword, UseTrusted, and AddonIdentifier.

From version 8.8, you can connect without supplying database credentials. The new security mechanism stores the database credentials in the System Landscape Directory (SLD) server.

Related Tasks

  • To retrieve a list of company databases for a specific server, use the GetCompanyList method.
  • To check if the connection to the database is successful, use the Connected property.

Example

See Also