Home | Previous Page | Next Page   Function Descriptions >

mi_get_connection_option( )

The mi_get_connection_option( ) function returns information about the database of the current connection.

Syntax

mi_integer mi_get_connection_option(conn, conn_option, result_ptr)
   MI_CONNECTION *conn;
   const mi_integer conn_option;
   mi_integer *result_ptr;
conn
is a pointer to a connection descriptor established by a previous call to mi_open( ), mi_server_connect( ), or mi_server_reconnect( ).
conn_option
is an integer constant to indicate which connection attribute to obtain. For a list of valid constants, see the following "Usage" section.
result_ptr
is a pointer to the connection information that mi_get_connection_option( ) obtains.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The mi_get_connection_option( ) function puts information about the connection attribute that conn specifies in the location that result_ptr references.

The following table lists the valid values for conn_option and the associated possible values that result_ptr references.

Description Connection-Option Constant Result
Is the open database an ANSI-compliant database? MI_IS_ANSI_DB MI_TRUE or
MI_FALSE
Does the open database use a transaction log? MI_IS_LOGGED_DB MI_TRUE or
MI_FALSE
Is the database in exclusive mode?

(Has the DATABASE statement included the EXCLUSIVE keyword?)

MI_IS_EXCLUSIVE_DB MI_TRUE or
MI_FALSE

This function copies this value into the buffer that result_ptr references. The function allocates memory for the result in the current memory duration. When you no longer need this result, free this memory.

Return Values

MI_OK
indicates that the function was successful.
MI_ERROR
indicates that the function was not successful or the conn_option argument is unknown.

The mi_get_connection_option( ) function raises an exception for the following conditions:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]