The mi_server_connect() function

The mi_server_connect() function establishes a connection between a client LIBMI application and a database server.

Syntax

MI_CONNECTION *mi_server_connect(conn_info)
   MI_CONNECTION_INFO *conn_info;
conn_info
A pointer to a connection-information descriptor that identifies a database server.
Valid in client LIBMI application? Valid in user-defined routine?
Yes No

Usage

The mi_server_connect() function establishes a client connection that connects the client LIBMI application to the database server identified by the connection-information structure that conn_info references. The establishment of a client connection begins a session. The mi_server_connect() function obtains a connection descriptor for the client connection. This function is a constructor function for a connection descriptor. The new connection descriptor is valid until the end of the session.

Use this function for client LIBMI applications that run against different database servers.

The mi_server_connect() function also initializes the DataBlade® API when it is the first DataBlade® API function in a client LIBMI application.

For a description of the connection-information descriptor or general information about how to establish a session with mi_server_connect(), see the Informix® DataBlade® API Programmer's Guide.

Return values

An MI_CONNECTION pointer
A pointer to the connection descriptor for the newly established connection.
NULL
The function was not successful.