Connecting to a server

A connection enables an Embedded SQL program to access a database and perform SQL operations.

Use the connect statement to establish a connection between an application program and Adaptive Server. If an application uses both C and COBOL languages, the first connect statement must be issued from a COBOL program. See Open Client Embedded SQL/COBOL Programmers Guide for information.

The syntax for the connect statement is:

exec sql connect :user [identified by :password]  
 [at :connection_name] [using :server] 

Each of the following sections describes one of the connect statement’s arguments. Only the user argument is required for the connect statement. The other arguments are optional.