lrd_open_connection

Connects (logs in) to the database.

LRDRET lrd_open_connection( LRD_CONNECTION **mpptConnection, unsigned int muiDBType, char *mpszUser, char *mpszPassword, char *mpszServer, char *mpszExtConnectStr, LRD_CONTEXT *mptContext, long mliOption, int miDBErrorSeverity );

mpptConnection A pointer to a pointer to an LRD_CONNECTION structure.
muiDBType The target database type.
mpszUser A pointer to the database user ID.
mpszPassword A pointer to the database user password.
mpszServer A pointer to the database server name.
mpszExtConnectStr A pointer to an extended connection string.
mptContext A pointer to an LRD_CONTEXT structure. NULL for all other databases.
mliOption ODBC only - One of the Open Connection options.
miDBErrorSeverityThe Error Severity Levels of a failure in a database routine.

The lrd_open_connection function sets up the LRD_CONNECTION structure. The structure is valid until it is freed with lrd_close_connection.

For more details refer to the Function Header File lrd.h in the include directory.

Return Values

See LRD Return Values.

Parameterization

The following arguments can be parameterized using standard parameterization: mpszUser, mpszPassword, mpszServer, mpszExtConnectStr

Example

In the following example, the lrd_open_connection function opens a connection to a Oracle database after initializing the environment with lrd_init (in the vuser_init section).

lrd_open_connection(&Con1, LRD_DBTYPE_ORACLE, "bb", "lion", "hammer", "", 0, 0, 0);
lrd_open_cursor(&Csr1, Con1, 0);