| Connect Method | |
| See Also |
Connects to the SAP Business One company database.
| Visual Basic |
|---|
Public Function Connect() As Long |
0 if the method succeeds; otherwise, an error code.
You can retrieve the last error code and its description with the method GetLastError.
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.