Establishing a connection with the CONNECT( ) method
The CONNECT( ) method takes up to four character string arguments in the following order, all of which are optional, depending on the configuration of your AppServer environment:
1. connection-parameters
2. userid
3. password
4. appserver-info
You use the connection-parameters argument to locate and configure the connection to one or more AppServer instances that support the required business function (application service).
The userid, password, and appserver-info arguments apply only to session-managed configurations and are passed from the client application to the AppServer, which passes them to the Connect procedure (if defined). If a Connect procedure is not defined for the connected AppServer, these arguments are discarded. The requirement to specify these arguments depends entirely on the application service defined for the connected AppServer.
An AppServer can reject a connection request if:
The Connect procedure fails
There are not enough system resources (for example, AppServer agents) available to service the connection
The specified session model for the connection is incorrect
A runtime error is generated when a connection is rejected by an AppServer.
In session-managed mode, the AppServer Connect procedure has the ability to return a user-defined string if it uses the RETURNstring or RETURN ERRORstring statements. To access the string, simply use the ABL RETURN-VALUE function in your client-side connection code. A null value indicates that the Connect procedure did not return a string.