Try OpenEdge Now
skip to main content
Application Migration and Development Guide
Application Development with PAS for OpenEdge : Programming ABL Client Applications : Connecting to a PAS for OpenEdge instance : Establishing a connection with the CONNECT( ) method
 
Establishing a connection with the CONNECT( ) method
The CONNECT( ) method takes up to four character string arguments in the following order, only one (connection-parameters) is required, depending on application model of the connection and the parameter requirements of any configured Connect procedure for the PAS for OpenEdge instance:
1. connection-parameters
2. userid
3. password
4. appserver-info
You use the connection-parameters argument to specify the location and connection configuration for a PAS for OpenEdge instance that supports a given business application. For more information, see Connection parameters argument.
The userid, password, and appserver-info arguments apply only to session-managed configurations and are passed from the client application to the Connect procedure (if configured) on the PAS for OpenEdge instance. Note that these parameters are never validated by the APSV transport or otherwise handled by the PAS for OE instance except to pass them to the Connect procedure. If a Connect procedure is not defined for the connected PAS for OpenEdge instance, or the connection is session-free, these arguments are discarded. The actual use and meaning of these parameters depends entirely on the Connect procedure and the associated business application running on the PAS for OE instance. For more information, see Session-managed application arguments.
A connection request can fail if:
*The server handle is invalid.
*One of the CONNECT( ) method parameters contains an invalid value.
*One of the values, such as the application model, specified in the connection-parameters parameter is invalid.
*There are not enough PAS for OpenEdge resources (for example, server sessions) available to service the connection.
*The Connect procedure fails.
*The Connect procedure terminates with a STOP condition, a QUIT condition, or after executing a RETURN ERROR statement.
A run-time error is generated when a connection is rejected by the server. If any error causes the connection request to fail, the CONNECT( ) method returns FALSE; otherwise it returns TRUE.
A successful connection lasts until the client application invokes the server handle DISCONNECT( ) method or until the server session detects any failure conditions that automatically terminate the connection. For more information on disconnecting from a PAS for OpenEdge instance, see Disconnecting from a PAS for OpenEdge instance.
* Connection parameters argument
* Connection URL syntax for the APSV transport
* Session-managed application arguments