![]() |
|
The mi_get_default_database_info() function populates a database-information descriptor with the default database parameters.
db_info | is a pointer to a user-allocated database-information descriptor, which stores the default database parameters. |
The mi_get_default_database_info() function returns default database parameters into 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_get_default_database_info().
If no default value exists for a particular field, the mi_get_default_database_info() function sets string fields to a NULL-valued pointer and integer fields to 0.
The mi_get_default_database_info() function also initializes the DataBlade API when it is the first DataBlade API function in a client LIBMI application or a user-defined routine.
In a user-defined routine, mi_get_default_database_info() retrieves the same information as mi_get_database_info().
In a client LIBMI application, you can set the application database parameters with the mi_set_default_database_info() function.
MI_OK | indicates that the function was successful. |
MI_ERROR | indicates that the function was not successful. |
See the descriptions of the following functions: mi_get_database_info(), mi_login(), mi_open(), and mi_set_default_database_info().
For more information on the database-information descriptor, see Using Database Parameters.