SetSession

If there is more than one ERP connection and a transaction may need them independently but at the same time, ERP.SetSession will direct embedded business functions to the specified session, ignoring the defaults. The ‘DataSource’ method will overwrite this function if it is included in the VBA code.

Group: Enterprise Resource Planning Extensions


Syntax: [bValue =] ERP.SetSession (vSource)

bValue     (Boolean) Optional – A True/False notification that the command processed successfully

vSource   (Variant) data source name (DSN) or the data source number. Setting this value to 0 will re-enable automatic determination of which data connection should be used based on which connection was used to download a particular business function being called.

Example:

Dim bValue As Boolean

bValue = ERP.SetSession(1)

ERP.SetSession("SAP")