INFORMIX
DataBlade API Programmer's Manual
Chapter 5: Managing Sessions
Home Contents Index Master Index New Book

Connections with mi_open()

The mi_open() function establishes a connection to a database server and opens a specified database in that server. For more information about mi_open(), see the description of this function in Chapter 12.

On the client side, the default database server has the name that the $INFORMIXSERVER environment variable specifies.

If shared-memory communication is used, only one connection from a client is allowed.

When you no longer need a connection, close it with mi_close().

Client Example: connect1.c

The following user code demonstrates the simplest way to initiate a connection to the default database server and to open a database. In this example, the name of the database to be opened is passed on the command line. The user_name and the user_password arguments to mi_open() are both passed as NULL, which indicates that the default user and password should be used.




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.