informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_set_default_database_info()

The mi_set_default_database_info() function sets the default database parameters with values in a user-provided database-information descriptor

Syntax

Usage

The mi_set_default_database_info() function sets default database parameters from the database-information descriptor (MI_DATABASE_INFO structure) that db_info references. The database parameters include the name of the database, the user account, and the account password. You can then pass the db_info descriptor to mi_login() to specify the default database parameters for a connection. The mi_open() function can also use these default database parameters when it establishes a connection.

Tip: You must allocate this database-information descriptor before you call mi_set_default_database_info().

If you do not wish to change a particular default value, sets string fields to a NULL-valued pointer and integer fields to 0.

In a user-defined routine, the mi_set_default_database_info() function is ignored.

The mi_set_default_database_info() function initializes the DataBlade API when it is the first DataBlade API function in a client LIBMI application or a UDR.

You can obtain the current database parameters with the mi_get_default_database_info() function.

Return Values

MI_OK indicates that the function was successful.
MI_ERROR indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_get_database_info(), mi_get_default_database_info(), mi_login(), mi_open(), and mi_sysname().

For more information on the database-information descriptor, see Using Database Parameters.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved